]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Clear scan cache at the end of ap_wps_per_station_psk_failure
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 13 Dec 2016 11:03:52 +0000 (13:03 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 13 Dec 2016 11:03:52 +0000 (13:03 +0200)
It was possible for ap_wps_per_station_psk_failure to leave behind scan
entries with active PBC mode if cfg80211 BSS table. This could result in
a following test case failing due PBC overlap. Fix this by clearing the
cfg80211 BSS table explicitly.

This was found with the following test case sequence:
ap_wps_per_station_psk_failure autogo_pbc

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_wps.py

index 80ad2262b59a27eb7eb8db2df845e7ded2ff39a5..f1e97da29b8ccf17cbe460ba88d337bc1328648c 100644 (file)
@@ -2189,6 +2189,7 @@ def test_ap_wps_per_station_psk_failure(dev, apdev):
     except:
         pass
 
+    hapd = None
     try:
         with open(pskfile, "w") as f:
             f.write("# WPA PSKs\n")
@@ -2222,6 +2223,12 @@ def test_ap_wps_per_station_psk_failure(dev, apdev):
         if len(psks) > 0:
             raise Exception("PSK recorded unexpectedly")
     finally:
+        if hapd:
+            for i in range(3):
+                dev[i].request("DISCONNECT")
+            hapd.disable()
+            for i in range(3):
+                dev[i].flush_scan_cache()
         os.remove(pskfile)
 
 def test_ap_wps_pin_request_file(dev, apdev):