diff --git a/tests/hwsim/test_wext.py b/tests/hwsim/test_wext.py index e14eecede..d67788ba8 100644 --- a/tests/hwsim/test_wext.py +++ b/tests/hwsim/test_wext.py @@ -108,7 +108,7 @@ def test_wext_pmksa_cache(dev, apdev): # of scanning to avoid reporting errors incorrectly just because of scans # not having seen the target AP. for i in range(3): - wpas.scan() + wpas.scan(timeout=30) if wpas.get_bss(bssid2) is not None: break logger.info("Scan again to find target AP") @@ -125,7 +125,7 @@ def test_wext_pmksa_cache(dev, apdev): wpas.dump_monitor() logger.info("Roam back to AP1") - wpas.scan() + wpas.scan(timeout=30) wpas.request("ROAM " + bssid) ev = wpas.wait_event(["CTRL-EVENT-EAP-STARTED", "CTRL-EVENT-CONNECTED"], timeout=15) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 4a2830c25..d6b4c4891 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -1155,7 +1155,7 @@ class WpaSupplicant: return id def scan(self, type=None, freq=None, no_wait=False, only_new=False, - passive=False): + passive=False, timeout=15): if not no_wait: self.dump_monitor() if type: @@ -1176,7 +1176,7 @@ class WpaSupplicant: if no_wait: return ev = self.wait_event(["CTRL-EVENT-SCAN-RESULTS", - "CTRL-EVENT-SCAN-FAILED"], 15) + "CTRL-EVENT-SCAN-FAILED"], timeout) if ev is None: raise Exception("Scan timed out") if "CTRL-EVENT-SCAN-FAILED" in ev: