]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make ap_wps_ap_scan_2 more robust
authorJouni Malinen <j@w1.fi>
Thu, 18 Jun 2015 19:33:48 +0000 (22:33 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 18 Jun 2015 19:33:48 +0000 (22:33 +0300)
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 <j@w1.fi>
tests/hwsim/test_ap_wps.py
tests/hwsim/test_scan.py

index ec15274485535c9a26c448be30da7bdd9fa4d64e..e64da5aa510292ba3c278d39ef2cc8ed14b61cff 100644 (file)
@@ -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)
index e05aebc6abc7be79c1502bf96c0e0b7e37c19727..20c245264ecd0be96f9f6e20753f08c2e11cf536 100644 (file)
@@ -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"""