]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make INTERWORKING_SELECT tests more robust
authorJouni Malinen <j@w1.fi>
Sat, 26 Apr 2014 13:01:52 +0000 (16:01 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Apr 2014 09:52:10 +0000 (12:52 +0300)
It is possible for a scan to fail to see Probe Response or Beacon frame
under heavy load (e.g., during a parallel-vm.sh test run) since the
dwell time on a chanenl is quite short. Make the test cases using
INTERWORKING_SELECT more robust by trying again if the first attempt
does not find a matching BSS.

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

index e542bb67ac53d498e952edd68e1979be06ceffef..a0a5c1125f1bd9d347aa943a7b48f6dea7807dad 100644 (file)
@@ -67,7 +67,15 @@ def interworking_select(dev, bssid, type=None, no_match=False, freq=None):
             raise Exception("Unexpected network match")
         return
     if "INTERWORKING-NO-MATCH" in ev:
-        raise Exception("Matching network not found")
+        logger.info("Matching network not found - try again")
+        dev.dump_monitor()
+        dev.request("INTERWORKING_SELECT" + freq_extra)
+        ev = dev.wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH"],
+                            timeout=15)
+        if ev is None:
+            raise Exception("Network selection timed out");
+        if "INTERWORKING-NO-MATCH" in ev:
+            raise Exception("Matching network not found")
     if bssid and bssid not in ev:
         raise Exception("Unexpected BSSID in match")
     if type and "type=" + type not in ev: