]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix BSS table flushing and old result ignoring for WPS tests
authorJouni Malinen <j@w1.fi>
Sun, 31 Mar 2013 14:55:16 +0000 (17:55 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 31 Mar 2013 15:05:42 +0000 (18:05 +0300)
The WPS tests are more prone to fail if scan results from the previous
test cases are allowed to remain in the wpa_supplicant BSS table during
the consecutive test since the test setup uses the same BSSID for the
test APs that change their configuration. Avoid these mostly bogus
issues by enforcing wpa_supplicant to drop and ignore old scan results
during the WPS test cases.

Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/test_ap_wps.py
tests/hwsim/wpasupplicant.py

index 63a2ed5f630f1532297bf0a539c939926ecb2273..1b44de0ef57392e8a8f183963051712e000f0b42 100644 (file)
@@ -92,7 +92,7 @@ def test_ap_wps_conf_pin(dev, apdev):
 
 def test_ap_wps_reg_connect(dev, apdev):
     """WPS registrar using AP PIN to connect"""
-    ssid = "test-wps-conf-ap-pin"
+    ssid = "test-wps-reg-ap-pin"
     appin = "12345670"
     hostapd.add_ap(apdev[0]['ifname'],
                    { "ssid": ssid, "eap_server": "1", "wps_state": "2",
@@ -100,7 +100,8 @@ def test_ap_wps_reg_connect(dev, apdev):
                      "wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
                      "ap_pin": appin})
     logger.info("WPS provisioning step")
-    dev[0].request("BSS_FLUSH")
+    dev[0].request("BSS_FLUSH 0")
+    dev[0].request("SET ignore_old_scan_res 1")
     dev[0].dump_monitor()
     dev[0].request("WPS_REG " + apdev[0]['bssid'] + " " + appin)
     ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
@@ -124,7 +125,8 @@ def test_ap_wps_reg_config(dev, apdev):
                    { "ssid": ssid, "eap_server": "1", "wps_state": "2",
                      "ap_pin": appin})
     logger.info("WPS configuration step")
-    dev[0].request("BSS_FLUSH")
+    dev[0].request("BSS_FLUSH 0")
+    dev[0].request("SET ignore_old_scan_res 1")
     dev[0].dump_monitor()
     new_ssid = "wps-new-ssid"
     new_passphrase = "1234567890"
@@ -175,8 +177,10 @@ def test_ap_wps_pbc_overlap_2sta(dev, apdev):
     hapd = hostapd.Hostapd(apdev[0]['ifname'])
     logger.info("WPS provisioning step")
     hapd.request("WPS_PBC")
-    dev[0].request("BSS_FLUSH")
-    dev[1].request("BSS_FLUSH")
+    dev[0].request("SET ignore_old_scan_res 1")
+    dev[0].request("BSS_FLUSH 0")
+    dev[1].request("SET ignore_old_scan_res 1")
+    dev[1].request("BSS_FLUSH 0")
     dev[0].dump_monitor()
     dev[1].dump_monitor()
     dev[0].request("WPS_PBC")
index 03017061b15a2b3c377b507c778c701510fb23eb..d151a3fb835cc587aba24bf77edead382714fe29 100644 (file)
@@ -45,6 +45,7 @@ class WpaSupplicant:
         self.request("REMOVE_CRED *")
         self.request("SET tdls_disabled 0")
         self.request("SET tdls_testing 0")
+        self.request("SET ignore_old_scan_res 0")
         self.group_ifname = None
 
     def add_network(self):