mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Merge branch 'fix/enhance_wifi_connection_check_in_ot_ci_case_v5.4' into 'release/v5.4'
feat(openthread): enhance wifi connection check in openthread ci cases (Backport v5.4) See merge request espressif/esp-idf!35164
This commit is contained in:
commit
dac9e60690
@ -114,18 +114,15 @@ def wait_for_join(dut:IdfDut, role:str) -> bool:
|
|||||||
def joinWiFiNetwork(dut:IdfDut, wifi:wifi_parameter) -> Tuple[str, int]:
|
def joinWiFiNetwork(dut:IdfDut, wifi:wifi_parameter) -> Tuple[str, int]:
|
||||||
clean_buffer(dut)
|
clean_buffer(dut)
|
||||||
ip_address = ''
|
ip_address = ''
|
||||||
information = ''
|
|
||||||
for order in range(1, wifi.retry_times):
|
for order in range(1, wifi.retry_times):
|
||||||
command = 'wifi connect -s ' + str(wifi.ssid) + ' -p ' + str(wifi.psk)
|
command = 'wifi connect -s ' + str(wifi.ssid) + ' -p ' + str(wifi.psk)
|
||||||
tmp = get_ouput_string(dut, command, 10)
|
tmp = get_ouput_string(dut, command, 10)
|
||||||
if 'sta ip' in str(tmp):
|
if 'sta ip' in str(tmp):
|
||||||
ip_address = re.findall(r'sta ip: (\w+.\w+.\w+.\w+),', str(tmp))[0]
|
ip_address = re.findall(r'sta ip: (\w+.\w+.\w+.\w+),', str(tmp))[0]
|
||||||
if 'wifi sta' in str(tmp):
|
execute_command(dut, 'wifi state')
|
||||||
information = re.findall(r'wifi sta (\w+ \w+ \w+)\W', str(tmp))[0]
|
if dut.expect('\nconnected\r', timeout=5):
|
||||||
if information == 'is connected successfully':
|
return ip_address, order
|
||||||
break
|
raise Exception(f'{dut} connect wifi {str(wifi.ssid)} with password {str(wifi.psk)} fail')
|
||||||
assert information == 'is connected successfully'
|
|
||||||
return ip_address, order
|
|
||||||
|
|
||||||
|
|
||||||
def getDeviceRole(dut:IdfDut) -> str:
|
def getDeviceRole(dut:IdfDut) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user