tests: Make FT test cases more robust
authorJouni Malinen <j@w1.fi>
Wed, 14 May 2014 14:02:32 +0000 (17:02 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 15 May 2014 13:56:59 +0000 (16:56 +0300)
Scan explicitly for the AP that may be started during the test case
execution. This is needed to work around issues where under heavy CPU
load, the single active scan round may miss the delayed Probe Response
from the second AP. In addition, check for ROAM/FT_DS failures to be
able to report errors more clearly.

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

index b65c4bd..5bf444c 100644 (file)
@@ -109,6 +109,7 @@ def run_roams(dev, apdev, ssid, passphrase, over_ds=False, sae=False, eap=False,
     hwsim_utils.test_connectivity(dev.ifname, ap1['ifname'])
 
     logger.info("Roam to the second AP")
+    dev.scan_for_bss(ap2['bssid'], freq="2412")
     if over_ds:
         dev.roam_over_ds(ap2['bssid'], fail_test=fail_test)
     else:
index 6dad86c..a1a32fb 100644 (file)
@@ -720,7 +720,8 @@ class WpaSupplicant:
 
     def roam(self, bssid, fail_test=False):
         self.dump_monitor()
-        self.request("ROAM " + bssid)
+        if "OK" not in self.request("ROAM " + bssid):
+            raise Exception("ROAM failed")
         if fail_test:
             ev = self.wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
             if ev is not None:
@@ -734,7 +735,8 @@ class WpaSupplicant:
 
     def roam_over_ds(self, bssid, fail_test=False):
         self.dump_monitor()
-        self.request("FT_DS " + bssid)
+        if "OK" not in self.request("FT_DS " + bssid):
+            raise Exception("FT_DS failed")
         if fail_test:
             ev = self.wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
             if ev is not None: