Skip to content

Commit 44ec704

Browse files
committed
Merge branch 'fix/enhance_wifi_connection_check_in_ot_ci_case' into 'master'
feat(openthread): enhance wifi connection check in openthread ci cases Closes TZ-1310 and IDFCI-2428 See merge request espressif/esp-idf!35159
2 parents 3075efd + 0fcbf42 commit 44ec704

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

examples/openthread/ot_ci_function.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,15 @@ def wait_for_join(dut:IdfDut, role:str) -> bool:
114114
def joinWiFiNetwork(dut:IdfDut, wifi:wifi_parameter) -> Tuple[str, int]:
115115
clean_buffer(dut)
116116
ip_address = ''
117-
information = ''
118117
for order in range(1, wifi.retry_times):
119118
command = 'wifi connect -s ' + str(wifi.ssid) + ' -p ' + str(wifi.psk)
120119
tmp = get_ouput_string(dut, command, 10)
121120
if 'sta ip' in str(tmp):
122121
ip_address = re.findall(r'sta ip: (\w+.\w+.\w+.\w+),', str(tmp))[0]
123-
if 'wifi sta' in str(tmp):
124-
information = re.findall(r'wifi sta (\w+ \w+ \w+)\W', str(tmp))[0]
125-
if information == 'is connected successfully':
126-
break
127-
assert information == 'is connected successfully'
128-
return ip_address, order
122+
execute_command(dut, 'wifi state')
123+
if dut.expect('\nconnected\r', timeout=5):
124+
return ip_address, order
125+
raise Exception(f'{dut} connect wifi {str(wifi.ssid)} with password {str(wifi.psk)} fail')
129126

130127

131128
def getDeviceRole(dut:IdfDut) -> str:

0 commit comments

Comments
 (0)