]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Clear scan results at the end of scan-ssid-list tests
authorJouni Malinen <j@w1.fi>
Sat, 20 Feb 2021 14:01:32 +0000 (16:01 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 20 Feb 2021 14:01:32 +0000 (16:01 +0200)
These test cases use hidden SSIDs and left behind a BSS entry with no
SSID. That can cause issues for consecutive test cases where the BSSID
can be used as the key for finding a BSS entry. That could end up
picking the old hidden SSID BSS instead of the one that was meant to be
used in the test case.

Flush the scan cache at the end of the scan-ssid-list test cases to
reduce invalid test failures for the consecutive test cases.

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

index cbe8371b13522f5db7de2c5ebe035ddd36eae9bf..b0d5a64e4aac02ca98f60a24ff25daec6237a8a7 100644 (file)
@@ -1989,6 +1989,9 @@ def test_scan_ssid_list(dev, apdev):
                 break
     finally:
         dev[0].request("VENDOR_ELEM_REMOVE 14 *")
+        hapd.disable()
+        dev[0].flush_scan_cache(freq=2432)
+        dev[0].flush_scan_cache()
 
     if not found:
         raise Exception("AP not found in scan results")
@@ -2014,6 +2017,9 @@ def test_scan_short_ssid_list(dev, apdev):
                 break
     finally:
         dev[0].request("VENDOR_ELEM_REMOVE 14 *")
+        hapd.disable()
+        dev[0].flush_scan_cache(freq=2432)
+        dev[0].flush_scan_cache()
 
     if not found:
         raise Exception("AP not found in scan results")