]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make scan_hidden more robust under heavy CPU load
authorJouni Malinen <j@w1.fi>
Fri, 2 Jan 2015 16:21:25 +0000 (18:21 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 2 Jan 2015 20:50:27 +0000 (22:50 +0200)
It is possible for the Probe Response frame wait to time out when active
scanning is used under heavy CPU load. Make this test case more robust
by trying multiple times before declaring the scan for a hidden SSID to
have failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_scan.py

index 4939903f373f5ca2cad6e493c3299a3ea8306b6f..4d32fd83645f5cb8ea4e85d802d5d3f3527e108c 100644 (file)
@@ -427,8 +427,16 @@ def test_scan_hidden(dev, apdev):
     if "test-scan" in dev[0].request("SCAN_RESULTS"):
         raise Exception("BSS unexpectedly found in scan")
 
-    check_scan(dev[0], "scan_id=%d,%d,%d freq=2412 use_id=1" % (id1, id2, id3))
-    if "test-scan" not in dev[0].request("SCAN_RESULTS"):
+    # Allow multiple attempts to be more robust under heavy CPU load that can
+    # result in Probe Response frames getting sent only after the station has
+    # already stopped waiting for the response on the channel.
+    found = False
+    for i in range(10):
+        check_scan(dev[0], "scan_id=%d,%d,%d freq=2412 use_id=1" % (id1, id2, id3))
+        if "test-scan" in dev[0].request("SCAN_RESULTS"):
+            found = True
+            break
+    if not found:
         raise Exception("BSS not found in scan")
 
     if "FAIL" not in dev[0].request("SCAN scan_id=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17"):