tests: Make flush_scan_cache() more robust
authorJouni Malinen <j@w1.fi>
Sun, 14 Dec 2014 23:13:03 +0000 (01:13 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Dec 2014 23:13:03 +0000 (01:13 +0200)
It was possible for BSS entries on the scanned channel (2412 MHz) to be
left behind after flush_scan_cache() call. Use a less likely channel
2417 MHz as the default channel to scan. This will hopefully get rid of
most problematic BSS entries from previous test cases. For example,
ap_hs20_oen followed by ap_hs20_random_mac could fail due to
INTERWORKING_CONNECT seeing non-RSN scan result from the previous test
case.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/wpasupplicant.py

index d5055a7..d3a9e80 100644 (file)
@@ -845,9 +845,9 @@ class WpaSupplicant:
                 return
         raise Exception("Could not find BSS " + bssid + " in scan")
 
-    def flush_scan_cache(self):
+    def flush_scan_cache(self, freq=2417):
         self.request("BSS_FLUSH 0")
-        self.scan(freq=2412, only_new=True)
+        self.scan(freq=freq, only_new=True)
 
     def roam(self, bssid, fail_test=False):
         self.dump_monitor()