From e51c8b2e970433f1bb017895c1c06ea7f3e7076c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 18 Jun 2015 22:33:48 +0300 Subject: [PATCH] tests: Make ap_wps_ap_scan_2 more robust The test sequence "scan_and_bss_entry_removed ap_wps_ap_scan_2" resulted in failure due to an old BSS entry remaining from the first test case to the second and the WPS_PBC operation on a forced BSSID ending up picking the incorrect BSS entry. Make this more robust by clearing the scan results from cfg80211. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 1 + tests/hwsim/test_scan.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index ec1527448..e64da5aa5 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -2513,6 +2513,7 @@ def test_ap_wps_ap_scan_2(dev, apdev): if "OK" not in wpas.request("AP_SCAN 2"): raise Exception("Failed to set AP_SCAN 2") + wpas.flush_scan_cache() wpas.scan_for_bss(apdev[0]['bssid'], freq="2412") wpas.request("WPS_PBC " + apdev[0]['bssid']) ev = wpas.wait_event(["WPS-SUCCESS"], timeout=15) diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index e05aebc6a..20c245264 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -539,6 +539,10 @@ def test_scan_and_bss_entry_removed(dev, apdev): dev[0].wait_connected(timeout=15, error="No connection (sme-connect)") wpas.wait_connected(timeout=15, error="No connection (connect)") + dev[0].request("DISCONNECT") + wpas.request("DISCONNECT") + dev[0].flush_scan_cache() + wpas.flush_scan_cache() def test_scan_reqs_with_non_scan_radio_work(dev, apdev): """SCAN commands while non-scan radio_work is in progress"""