]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make ap_wps_er_add_enrollee check a bit more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 25 Apr 2014 19:45:12 +0000 (22:45 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Apr 2014 09:52:10 +0000 (12:52 +0300)
It is possible for the final step of the test case to fail under load
(e.g., when using parallel-vm.sh with large number of VMs), so run
through additional scan iterations if the WPS-AUTH flag does not get
removed immediately.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_wps.py

index 3a1a4265cf3d9c959c8eb0b41f70ff09a7ddaa28..2da499139b87b5a7c647b928241cbcd986b4c6d5 100644 (file)
@@ -886,11 +886,17 @@ def test_ap_wps_er_add_enrollee(dev, apdev):
     if ev is None:
         raise Exception("WPS ER unsubscription timed out")
     # It takes some time for the UPnP UNSUBSCRIBE command to go through, so wait
-    # a bit before verifying that the scan results have change.
+    # a bit before verifying that the scan results have changed.
     time.sleep(0.2)
 
-    dev[1].scan(freq="2412")
-    bss = dev[1].get_bss(apdev[0]['bssid'])
+    for i in range(0, 10):
+        dev[1].request("BSS_FLUSH 0")
+        dev[1].scan(freq="2412", only_new=True)
+        bss = dev[1].get_bss(apdev[0]['bssid'])
+        if bss and 'flags' in bss and "[WPS-AUTH]" not in bss['flags']:
+            break
+        logger.debug("WPS-AUTH flag was still in place - wait a bit longer")
+        time.sleep(0.1)
     if "[WPS-AUTH]" in bss['flags']:
         raise Exception("WPS-AUTH flag not removed")