Browse Source

tests: Make FT test cases more robust

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>
Jouni Malinen 10 years ago
parent
commit
655bc8bfd6
2 changed files with 5 additions and 2 deletions
  1. 1 0
      tests/hwsim/test_ap_ft.py
  2. 4 2
      tests/hwsim/wpasupplicant.py

+ 1 - 0
tests/hwsim/test_ap_ft.py

@@ -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:

+ 4 - 2
tests/hwsim/wpasupplicant.py

@@ -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: