From 655bc8bfd67b8d10235057824ca089e7826d9776 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 14 May 2014 17:02:32 +0300 Subject: [PATCH] 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 --- tests/hwsim/test_ap_ft.py | 1 + tests/hwsim/wpasupplicant.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index b65c4bd..5bf444c 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/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: diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 6dad86c..a1a32fb 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/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: -- 2.1.4