mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'feat/add_ot_ci_c5_related_testcases_v5.5' into 'release/v5.5'
feat(openthread): add C5 sleep test case (v5.5) See merge request espressif/esp-idf!45162
This commit is contained in:
@@ -58,10 +58,6 @@ examples/openthread/ot_sleepy_device/deep_sleep:
|
||||
examples/openthread/ot_sleepy_device/light_sleep:
|
||||
enable:
|
||||
- if: SOC_IEEE802154_SUPPORTED == 1
|
||||
disable:
|
||||
- if: IDF_TARGET in ["esp32c5"]
|
||||
temporary: true
|
||||
reason: Not supported yet, TZ-958
|
||||
<<: [*openthread_dependencies, *openthread_sleep_dependencies]
|
||||
|
||||
examples/openthread/ot_trel:
|
||||
|
||||
@@ -208,8 +208,9 @@ def reset_thread(dut: IdfDut) -> None:
|
||||
|
||||
def hardreset_dut(dut: IdfDut) -> None:
|
||||
dut.serial.hard_reset()
|
||||
time.sleep(5)
|
||||
dut.expect('OpenThread attached to netif', timeout=20)
|
||||
execute_command(dut, 'factoryreset')
|
||||
dut.expect('OpenThread attached to netif', timeout=20)
|
||||
|
||||
|
||||
# get the mleid address of the thread
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32-C6 | ESP32-H2 |
|
||||
| ----------------- | -------- | -------- |
|
||||
| Supported Targets | ESP32-C5 | ESP32-C6 | ESP32-H2 |
|
||||
| ----------------- | -------- | -------- | -------- |
|
||||
# OpenThread Sleepy Device Example
|
||||
|
||||
The example demonstrates the Thread Sleepy End Device (SED), the device will enter [Light Sleep mode](https://docs.espressif.com/projects/esp-idf/en/latest/esp32h2/api-reference/system/sleep_modes.html#sleep-modes) during idle state.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
# !/usr/bin/env python3
|
||||
import copy
|
||||
@@ -99,8 +99,9 @@ default_cli_ot_para = ocf.thread_parameter('router', '', '', '', False)
|
||||
ESPPORT1 = os.getenv('ESPPORT1')
|
||||
ESPPORT2 = os.getenv('ESPPORT2')
|
||||
ESPPORT3 = os.getenv('ESPPORT3')
|
||||
ESPPORT4 = os.getenv('ESPPORT4')
|
||||
|
||||
PORT_MAPPING = {'ESPPORT1': 'esp32h2', 'ESPPORT2': 'esp32s3', 'ESPPORT3': 'esp32c6'}
|
||||
PORT_MAPPING = {'ESPPORT1': 'esp32h2', 'ESPPORT2': 'esp32s3', 'ESPPORT3': 'esp32c6', 'ESPPORT4': 'esp32c5'}
|
||||
|
||||
|
||||
# Case 1: Thread network formation and attaching
|
||||
@@ -661,6 +662,15 @@ def test_TCP_NAT64(Init_interface: bool, dut: Tuple[IdfDut, IdfDut, IdfDut]) ->
|
||||
f'{ESPPORT3}|{ESPPORT1}',
|
||||
id='c6-h2',
|
||||
),
|
||||
pytest.param(
|
||||
'cli|sleepy',
|
||||
2,
|
||||
f'{os.path.join(os.path.dirname(__file__), "ot_cli")}'
|
||||
f'|{os.path.join(os.path.dirname(__file__), "ot_sleepy_device/light_sleep")}',
|
||||
'esp32h2|esp32c5',
|
||||
f'{ESPPORT1}|{ESPPORT4}',
|
||||
id='h2-c5',
|
||||
),
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@@ -677,10 +687,15 @@ def test_ot_sleepy_device(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
ocf.wait(leader, 5)
|
||||
dataset = ocf.getDataset(leader)
|
||||
ocf.execute_command(sleepy_device, 'mode -')
|
||||
sleepy_device.expect('Done', timeout=5)
|
||||
ocf.execute_command(sleepy_device, 'pollperiod 3000')
|
||||
sleepy_device.expect('Done', timeout=5)
|
||||
ocf.execute_command(sleepy_device, 'dataset set active ' + dataset)
|
||||
sleepy_device.expect('Done', timeout=5)
|
||||
ocf.execute_command(sleepy_device, 'ifconfig up')
|
||||
sleepy_device.expect('Done', timeout=5)
|
||||
ocf.execute_command(sleepy_device, 'thread start')
|
||||
sleepy_device.expect('Done', timeout=5)
|
||||
info = sleepy_device.expect(r'(.+)detached -> child', timeout=20)[1].decode(errors='replace')
|
||||
assert not bool(fail_info.search(str(info)))
|
||||
info = sleepy_device.expect(r'(.+)PMU_SLEEP_PD_TOP: True', timeout=10)[1].decode(errors='replace')
|
||||
@@ -693,7 +708,9 @@ def test_ot_sleepy_device(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
output = sleepy_device.expect(pexpect.TIMEOUT, timeout=5)
|
||||
assert not bool(fail_info.search(str(output)))
|
||||
finally:
|
||||
logging.info('Cleaning up...')
|
||||
ocf.execute_command(leader, 'factoryreset')
|
||||
leader.expect('OpenThread attached to netif', timeout=20)
|
||||
ocf.hardreset_dut(sleepy_device)
|
||||
time.sleep(3)
|
||||
|
||||
@@ -994,9 +1011,10 @@ def test_ot_ssed_device(dut: Tuple[IdfDut, IdfDut]) -> None:
|
||||
leader = dut[0]
|
||||
ssed_device = dut[1]
|
||||
try:
|
||||
ocf.hardreset_dut(ssed_device)
|
||||
ocf.clean_buffer(ssed_device)
|
||||
ssed_device.serial.hard_reset()
|
||||
# CI device must have external XTAL to run SSED case, we will check this here first
|
||||
ssed_device.expect('32k XTAL in use', timeout=10)
|
||||
ssed_device.expect('32k XTAL in use', timeout=20)
|
||||
ocf.init_thread(leader)
|
||||
time.sleep(3)
|
||||
leader_para = ocf.thread_parameter('leader', '', '12', '7766554433221100', False)
|
||||
|
||||
Reference in New Issue
Block a user