From 64008a1ee88b03cdd7675fc034ef7747ef42f728 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 16 Feb 2022 19:56:24 +0200 Subject: [PATCH] tests: Make SAE roaming test cases more reliable Flush the scan table explicitly to avoid issues with the ROAM command if the new AP is not found and an entry from a previous test case is used instead. This was happening in a number of cases where a SAE test case was run after sigma_dut_ap_cipher_gcmp_256 which used the second AP instance and allowed that to show up in the scan results in the next text case. Signed-off-by: Jouni Malinen --- tests/hwsim/test_sae.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py index abadc3037..d58297608 100644 --- a/tests/hwsim/test_sae.py +++ b/tests/hwsim/test_sae.py @@ -2506,6 +2506,7 @@ def test_sae_okc(dev, apdev): hapd = hostapd.add_ap(apdev[0], params) bssid = hapd.own_addr() + dev[0].flush_scan_cache() dev[0].set("sae_groups", "") id = dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE", okc=True, scan_freq="2412") @@ -2538,6 +2539,7 @@ def test_sae_okc_sta_only(dev, apdev): hapd = hostapd.add_ap(apdev[0], params) bssid = hapd.own_addr() + dev[0].flush_scan_cache() dev[0].set("sae_groups", "") id = dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE", okc=True, scan_freq="2412") @@ -2565,6 +2567,7 @@ def test_sae_okc_pmk_lifetime(dev, apdev): hapd = hostapd.add_ap(apdev[0], params) bssid = hapd.own_addr() + dev[0].flush_scan_cache() dev[0].set("sae_groups", "") dev[0].set("dot11RSNAConfigPMKLifetime", "10") dev[0].set("dot11RSNAConfigPMKReauthThreshold", "30") @@ -2607,6 +2610,7 @@ def test_sae_pmk_lifetime(dev, apdev): hapd2 = hostapd.add_ap(apdev[1], params) bssid2 = hapd2.own_addr() + dev[0].flush_scan_cache() dev[0].scan_for_bss(bssid2, freq=2412) dev[0].roam(bssid2) dev[0].dump_monitor() @@ -2682,6 +2686,7 @@ def test_sae_pmf_roam(dev, apdev): hapd = hostapd.add_ap(apdev[0], params) bssid = hapd.own_addr() + dev[0].flush_scan_cache() dev[0].set("sae_groups", "") id = dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE", ieee80211w="2", scan_freq="2412")