]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make flush_scan_cache() more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 12 Jun 2015 18:28:14 +0000 (21:28 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 12 Jun 2015 18:28:14 +0000 (21:28 +0300)
There seem to be cases where flush_scan_cache() was unable to clear all
BSS entries due to a hidden SSID BSS (SSID length 0) showing up again
from cfg80211 BSS table. Check for this and run the flush operation
again if any entries remain.

This fixes an issue where the following hwsim test case sequence
resulted in the last test case failing due to the old BSS entry from the
first test case being in place and showing unexpected flags information:
ap_hs20_min_bandwidth_home_hidden_ssid_in_scan_res
ap_hs20_remediation_required
ap_mixed_security

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

index cbb73f26e19293093aac30cab60bec2389369612..4f574e22432b3b04b364c59178920408de3d1b3c 100644 (file)
@@ -914,6 +914,13 @@ class WpaSupplicant:
     def flush_scan_cache(self, freq=2417):
         self.request("BSS_FLUSH 0")
         self.scan(freq=freq, only_new=True)
+        res = self.request("SCAN_RESULTS")
+        if len(res.splitlines()) > 1:
+            self.request("BSS_FLUSH 0")
+            self.scan(freq=2422, only_new=True)
+            res = self.request("SCAN_RESULTS")
+            if len(res.splitlines()) > 1:
+                logger.info("flush_scan_cache: Could not clear all BSS entries. These remain:\n" + res)
 
     def roam(self, bssid, fail_test=False):
         self.dump_monitor()