From b3f41349122b9ab60d5209305c3fbb3418b67c98 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 21 Dec 2014 21:58:47 +0200 Subject: [PATCH] tests: Clear cfg80211 BSS table at the end of scan_hidden 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 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 --- tests/hwsim/test_scan.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index 3f697848d..4a4d4f0f7 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -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",