Skip to content

Commit 6d8a856

Browse files
committed
Merge branch 'bugfix/update_thread_ci_testcases_v5.4' into 'release/v5.4'
feat(openthread): optimize fail cases in CI test (v5.4) See merge request espressif/esp-idf!43740
2 parents 14fdfcd + 871a406 commit 6d8a856

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

examples/openthread/ot_ci_function.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,15 @@ def joinThreadNetwork(dut: IdfDut, thread: thread_parameter) -> None:
141141

142142

143143
def wait_for_join(dut: IdfDut, role: str) -> bool:
144+
clean_buffer(dut)
144145
for _ in range(1, 30):
145-
if getDeviceRole(dut) == role:
146-
wait(dut, 5)
146+
time.sleep(1)
147+
execute_command(dut, 'state')
148+
try:
149+
dut.expect(re.compile(role), timeout=5)
147150
return True
148-
wait(dut, 1)
151+
except Exception:
152+
continue
149153
return False
150154

151155

examples/openthread/pytest_otbr.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,14 @@ def test_Bidirectional_IPv6_connectivity(Init_interface: bool, dut: Tuple[IdfDut
234234
onlinkprefix = ocf.get_onlinkprefix(br)
235235
pattern = rf'\W+({onlinkprefix}(?:\w+:){{3}}\w+)\W+'
236236
host_global_unicast_addr = re.findall(pattern, out_str)
237+
logging.info(f'host_global_unicast_addr: {host_global_unicast_addr}')
238+
if host_global_unicast_addr is None:
239+
raise Exception(f'onlinkprefix: {onlinkprefix}, host_global_unicast_addr: {host_global_unicast_addr}')
237240
rx_nums = 0
238241
for ip_addr in host_global_unicast_addr:
239242
txrx_nums = ocf.ot_ping(cli, str(ip_addr), count=10)
240243
rx_nums = rx_nums + int(txrx_nums[1])
241-
logging.debug(f'rx_nums: {rx_nums}')
244+
logging.info(f'rx_nums: {rx_nums}')
242245
assert rx_nums != 0
243246
finally:
244247
ocf.stop_thread(cli)

0 commit comments

Comments
 (0)