From: Jouni Malinen Date: Wed, 14 May 2014 14:02:32 +0000 (+0300) Subject: tests: Make FT test cases more robust X-Git-Tag: hostap_2_2~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=655bc8bfd67b8d10235057824ca089e7826d9776;p=thirdparty%2Fhostap.git 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 --- diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index b65c4bd39..5bf444cd6 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 6dad86c3a..a1a32fb5f 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: