Wifi_provisioning_mgr_test: Allow three attempts to connect to AP before concluding provisioning failure

This commit is contained in:
Prasad Alatkar 2020-03-12 20:23:04 +05:30 committed by bot
parent 8419aa85a9
commit 415ccf8518

View file

@ -91,6 +91,7 @@ def test_examples_wifi_prov_mgr(env, extra_data):
raise RuntimeError("Failed to send apply config") raise RuntimeError("Failed to send apply config")
success = False success = False
retry = 0
while True: while True:
time.sleep(5) time.sleep(5)
print("Wi-Fi connection state") print("Wi-Fi connection state")
@ -100,6 +101,10 @@ def test_examples_wifi_prov_mgr(env, extra_data):
elif (ret == 0): elif (ret == 0):
print("Provisioning was successful") print("Provisioning was successful")
success = True success = True
elif (ret == 3 and retry < 3):
retry = retry + 1
print("Connection failed.. retry again...: ", ret)
continue
break break
if not success: if not success: