]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: More scan result flushing to make testing more robust
authorJouni Malinen <j@w1.fi>
Sat, 12 Apr 2025 07:38:56 +0000 (10:38 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 12 Apr 2025 07:38:56 +0000 (10:38 +0300)
Test case sequence 'scan_chan_switch ssid_utf8' was failing due to a
scan result surviving from the first test case to the second and the old
entry ended up breaking check for the UTF-8 flag. Fix this by explicitly
flushing old scan results.

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

index 3024958047845c22d1ebe62d1a5966616ac60684..c51eef770f3bfba1e6f452d083c74a61ffca5c64 100644 (file)
@@ -1291,6 +1291,11 @@ def test_scan_chan_switch(dev, apdev):
     run_scan(dev[0], bssid, 2412)
     dev[0].dump_monitor()
 
+    dev[0].request("DISCONNECT")
+    dev[0].wait_disconnected()
+    hapd.disable()
+    dev[0].flush_scan_cache()
+
 def test_scan_new_only(dev, apdev):
     """Scan and only_new=1 multiple times"""
     dev[0].flush_scan_cache()
index faee75d5ff77ae5e9f4941add8a2b6ca4d659661..5bc813b73ec352e09f7e777e37e9ccab2b908d6c 100644 (file)
@@ -55,6 +55,7 @@ def test_ssid_32_octets_nul_term(dev, apdev):
 @remote_compatible
 def test_ssid_utf8(dev, apdev):
     """SSID with UTF8 encoding"""
+    dev[0].flush_scan_cache()
     hapd = hostapd.add_ap(apdev[0], {"ssid": 'testi-åäöÅÄÖ-testi',
                                      "utf8_ssid": "1"})
     dev[0].connect("testi-åäöÅÄÖ-testi", key_mgmt="NONE", scan_freq="2412")