Skip to content

Commit

Permalink
Merge branch 'fix/enhance_wifi_connection_check_in_ot_ci_case_v5.4' i…
Browse files Browse the repository at this point in the history
…nto 'release/v5.4'

feat(openthread): enhance wifi connection check in openthread ci cases (Backport v5.4)

See merge request espressif/esp-idf!35164
  • Loading branch information
chshu committed Nov 28, 2024
2 parents 60c5617 + 516e113 commit dac9e60
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions examples/openthread/ot_ci_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,15 @@ def wait_for_join(dut:IdfDut, role:str) -> bool:
def joinWiFiNetwork(dut:IdfDut, wifi:wifi_parameter) -> Tuple[str, int]:
clean_buffer(dut)
ip_address = ''
information = ''
for order in range(1, wifi.retry_times):
command = 'wifi connect -s ' + str(wifi.ssid) + ' -p ' + str(wifi.psk)
tmp = get_ouput_string(dut, command, 10)
if 'sta ip' in str(tmp):
ip_address = re.findall(r'sta ip: (\w+.\w+.\w+.\w+),', str(tmp))[0]
if 'wifi sta' in str(tmp):
information = re.findall(r'wifi sta (\w+ \w+ \w+)\W', str(tmp))[0]
if information == 'is connected successfully':
break
assert information == 'is connected successfully'
return ip_address, order
execute_command(dut, 'wifi state')
if dut.expect('\nconnected\r', timeout=5):
return ip_address, order
raise Exception(f'{dut} connect wifi {str(wifi.ssid)} with password {str(wifi.psk)} fail')


def getDeviceRole(dut:IdfDut) -> str:
Expand Down

0 comments on commit dac9e60

Please sign in to comment.