From 76232fd263ccc355dbe6d214a2146055823e5730 Mon Sep 17 00:00:00 2001 From: Shivani Tipnis Date: Sun, 21 Jun 2020 17:38:05 +0530 Subject: [PATCH] ci: Set sleep time to allow wlan0 to connect to softap --- examples/provisioning/legacy/softap_prov/softap_prov_test.py | 2 +- tools/ci/python_packages/wifi_tools.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/provisioning/legacy/softap_prov/softap_prov_test.py b/examples/provisioning/legacy/softap_prov/softap_prov_test.py index 238234c154..2c2693595a 100644 --- a/examples/provisioning/legacy/softap_prov/softap_prov_test.py +++ b/examples/provisioning/legacy/softap_prov/softap_prov_test.py @@ -55,7 +55,7 @@ def test_examples_provisioning_softap(env, extra_data): ctrl = wifi_tools.wpa_cli(iface, reset_on_exit=True) print("Connecting to DUT SoftAP...") ip = ctrl.connect(ssid, password) - got_ip = dut1.expect(re.compile(r"DHCP server assigned IP to a station, IP is: (\d+.\d+.\d+.\d+)"), timeout=30)[0] + got_ip = dut1.expect(re.compile(r"DHCP server assigned IP to a station, IP is: (\d+.\d+.\d+.\d+)"), timeout=45)[0] if ip != got_ip: raise RuntimeError("SoftAP connected to another host! " + ip + "!=" + got_ip) print("Connected to DUT SoftAP") diff --git a/tools/ci/python_packages/wifi_tools.py b/tools/ci/python_packages/wifi_tools.py index 13376e52e9..b06038a274 100644 --- a/tools/ci/python_packages/wifi_tools.py +++ b/tools/ci/python_packages/wifi_tools.py @@ -71,16 +71,17 @@ class wpa_cli: self.new_network = self.iface_ifc.AddNetwork({"ssid": ssid, "psk": password}) self.iface_ifc.SelectNetwork(self.new_network) + time.sleep(10) ip = None retry = 10 while retry > 0: - time.sleep(5) ip = get_wiface_IPv4(self.iface_name) if ip is not None: self.connected = True return ip retry -= 1 + time.sleep(3) self.reset() raise RuntimeError('wpa_cli : Connection failed')