From f164dd87b9a9722c35810d96b8a18b54e6e45de9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 12 Mar 2021 11:46:22 +0200 Subject: [PATCH] tests: Make INTERWORKING_SELECT test cases more reliable These could fail if a scan entry from a previous test case was still present in the BSS table, e.g., by wpa_supplicant selecting the SSID from that old entry instead of the new SSID. Try to avoid that by explicitly flushing the scan results before starting these tests. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index de781f764..9c4ba9597 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -2817,6 +2817,7 @@ def test_ap_hs20_osen_single_ssid(dev, apdev): def test_ap_hs20_network_preference(dev, apdev): """Hotspot 2.0 network selection with preferred home network""" check_eap_capa(dev[0], "MSCHAPV2") + dev[0].flush_scan_cache() bssid = apdev[0]['bssid'] params = hs20_ap_params() hostapd.add_ap(apdev[0], params) @@ -2858,6 +2859,7 @@ def test_ap_hs20_network_preference(dev, apdev): def test_ap_hs20_network_preference2(dev, apdev): """Hotspot 2.0 network selection with preferred credential""" check_eap_capa(dev[0], "MSCHAPV2") + dev[0].flush_scan_cache() bssid2 = apdev[1]['bssid'] params = hostapd.wpa2_params(ssid="home", passphrase="12345678") hostapd.add_ap(apdev[1], params) @@ -2899,6 +2901,7 @@ def test_ap_hs20_network_preference2(dev, apdev): def test_ap_hs20_network_preference3(dev, apdev): """Hotspot 2.0 network selection with two credential (one preferred)""" check_eap_capa(dev[0], "MSCHAPV2") + dev[0].flush_scan_cache() bssid = apdev[0]['bssid'] params = hs20_ap_params() hostapd.add_ap(apdev[0], params) @@ -2940,6 +2943,7 @@ def test_ap_hs20_network_preference3(dev, apdev): def test_ap_hs20_network_preference4(dev, apdev): """Hotspot 2.0 network selection with username vs. SIM credential""" check_eap_capa(dev[0], "MSCHAPV2") + dev[0].flush_scan_cache() bssid = apdev[0]['bssid'] params = hs20_ap_params() hostapd.add_ap(apdev[0], params)