]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Clear cfg80211 BSS table at the end of scan_hidden
authorJouni Malinen <j@w1.fi>
Sun, 21 Dec 2014 19:58:47 +0000 (21:58 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 21 Dec 2014 19:58:47 +0000 (21:58 +0200)
It was possible for the hidden SSID entry to leak into following test
cases and result in failures, e.g., in this sequence:

scan_hidden
scan_reqs_with_non_scan_radio_work
radius_auth_unreachable
wep_open_auth

BSS <BSSID> picked incorrect BSS entry within wpa_supplicant due to the
old zero-length SSID showing up from the earlier hidden SSID case.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_scan.py

index 3f697848ddd3d42ca035482afc8d7f71ad9af55a..4a4d4f0f70009912ab1c1dc489dc39e1ea45fc43 100644 (file)
@@ -409,8 +409,8 @@ def test_scan_for_auth_wep(dev, apdev):
 
 def test_scan_hidden(dev, apdev):
     """Control interface behavior on scan parameters"""
-    hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan",
-                                         "ignore_broadcast_ssid": "1" })
+    hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan",
+                                                "ignore_broadcast_ssid": "1" })
     bssid = apdev[0]['bssid']
 
     check_scan(dev[0], "freq=2412 use_id=1")
@@ -434,6 +434,11 @@ def test_scan_hidden(dev, apdev):
     if "FAIL" not in dev[0].request("SCAN scan_id=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17"):
         raise Exception("Too many scan_id values accepted")
 
+    hapd.disable()
+    dev[0].request("REMOVE_NETWORK all")
+    dev[0].flush_scan_cache(freq=2432)
+    dev[0].flush_scan_cache()
+
 def test_scan_and_bss_entry_removed(dev, apdev):
     """Last scan result and connect work processing on BSS entry update"""
     hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open",