From 64414f6085e04afb9d5e2eb72fafcb31cde881ce Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 12 Apr 2025 10:38:56 +0300 Subject: [PATCH] tests: More scan result flushing to make testing more robust 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 --- tests/hwsim/test_scan.py | 5 +++++ tests/hwsim/test_ssid.py | 1 + 2 files changed, 6 insertions(+) diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index 3024958047..c51eef770f 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -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() diff --git a/tests/hwsim/test_ssid.py b/tests/hwsim/test_ssid.py index faee75d5ff..5bc813b73e 100644 --- a/tests/hwsim/test_ssid.py +++ b/tests/hwsim/test_ssid.py @@ -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") -- 2.47.3