]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make INTERWORKING_SELECT test cases more reliable
authorJouni Malinen <j@w1.fi>
Fri, 12 Mar 2021 09:46:22 +0000 (11:46 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 12 Mar 2021 09:46:22 +0000 (11:46 +0200)
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 <j@w1.fi>
tests/hwsim/test_ap_hs20.py

index de781f764a43a854adf35ee80492c0b119f9c79f..9c4ba959751329d056d83af2bbcb77d0469b3bbe 100644 (file)
@@ -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)