tests: Fix BSS table flushing and old result ignoring for WPS tests

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>
This commit is contained in:
Jouni Malinen 2013-03-31 17:55:16 +03:00
parent 4342326fc7
commit 803edd1c09
2 changed files with 10 additions and 5 deletions

View 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")

View 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):