From 415ccf851801b9cdee49b50f42c15f34b7e37838 Mon Sep 17 00:00:00 2001 From: Prasad Alatkar Date: Thu, 12 Mar 2020 20:23:04 +0530 Subject: [PATCH] Wifi_provisioning_mgr_test: Allow three attempts to connect to AP before concluding provisioning failure --- examples/provisioning/wifi_prov_mgr/wifi_prov_mgr_test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/provisioning/wifi_prov_mgr/wifi_prov_mgr_test.py b/examples/provisioning/wifi_prov_mgr/wifi_prov_mgr_test.py index c0f4770f2..aa00d75c5 100644 --- a/examples/provisioning/wifi_prov_mgr/wifi_prov_mgr_test.py +++ b/examples/provisioning/wifi_prov_mgr/wifi_prov_mgr_test.py @@ -91,6 +91,7 @@ def test_examples_wifi_prov_mgr(env, extra_data): raise RuntimeError("Failed to send apply config") success = False + retry = 0 while True: time.sleep(5) print("Wi-Fi connection state") @@ -100,6 +101,10 @@ def test_examples_wifi_prov_mgr(env, extra_data): elif (ret == 0): print("Provisioning was successful") success = True + elif (ret == 3 and retry < 3): + retry = retry + 1 + print("Connection failed.. retry again...: ", ret) + continue break if not success: