mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(openthread): optimize fail cases in CI test
This commit is contained in:
@@ -137,11 +137,15 @@ def joinThreadNetwork(dut: IdfDut, thread: thread_parameter) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def wait_for_join(dut: IdfDut, role: str) -> bool:
|
def wait_for_join(dut: IdfDut, role: str) -> bool:
|
||||||
|
clean_buffer(dut)
|
||||||
for _ in range(1, 30):
|
for _ in range(1, 30):
|
||||||
if getDeviceRole(dut) == role:
|
time.sleep(1)
|
||||||
wait(dut, 5)
|
execute_command(dut, 'state')
|
||||||
|
try:
|
||||||
|
dut.expect(re.compile(role), timeout=5)
|
||||||
return True
|
return True
|
||||||
wait(dut, 1)
|
except Exception:
|
||||||
|
continue
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -229,11 +229,14 @@ def test_Bidirectional_IPv6_connectivity(Init_interface: bool, dut: tuple[IdfDut
|
|||||||
onlinkprefix = ocf.get_onlinkprefix(br)
|
onlinkprefix = ocf.get_onlinkprefix(br)
|
||||||
pattern = rf'\W+({onlinkprefix}(?:\w+:){{3}}\w+)\W+'
|
pattern = rf'\W+({onlinkprefix}(?:\w+:){{3}}\w+)\W+'
|
||||||
host_global_unicast_addr = re.findall(pattern, out_str)
|
host_global_unicast_addr = re.findall(pattern, out_str)
|
||||||
|
logging.info(f'host_global_unicast_addr: {host_global_unicast_addr}')
|
||||||
|
if host_global_unicast_addr is None:
|
||||||
|
raise Exception(f'onlinkprefix: {onlinkprefix}, host_global_unicast_addr: {host_global_unicast_addr}')
|
||||||
rx_nums = 0
|
rx_nums = 0
|
||||||
for ip_addr in host_global_unicast_addr:
|
for ip_addr in host_global_unicast_addr:
|
||||||
txrx_nums = ocf.ot_ping(cli, str(ip_addr), count=10)
|
txrx_nums = ocf.ot_ping(cli, str(ip_addr), count=10)
|
||||||
rx_nums = rx_nums + int(txrx_nums[1])
|
rx_nums = rx_nums + int(txrx_nums[1])
|
||||||
logging.debug(f'rx_nums: {rx_nums}')
|
logging.info(f'rx_nums: {rx_nums}')
|
||||||
assert rx_nums != 0
|
assert rx_nums != 0
|
||||||
finally:
|
finally:
|
||||||
ocf.stop_thread(cli)
|
ocf.stop_thread(cli)
|
||||||
|
|||||||
Reference in New Issue
Block a user