]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Work around race conditions in OWE test cases
authorJouni Malinen <j@w1.fi>
Fri, 12 Mar 2021 17:59:07 +0000 (19:59 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 12 Mar 2021 17:59:52 +0000 (19:59 +0200)
Need to explicitly wait for hostapd to report STA connection before
starting the traffic test to avoid the potential race condition when
testing with UML and time travel mode.

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

index b61bc59f25f8c8aa316bf57afc088f8002ecc070..3f29913cf532b862fd1e973d3df658a215658565 100644 (file)
@@ -64,10 +64,12 @@ def test_owe_groups(dev, apdev):
     dev[0].scan_for_bss(bssid, freq="2412")
     for group in [19, 20, 21]:
         dev[0].connect("owe", key_mgmt="OWE", owe_group=str(group))
+        hapd.wait_sta()
         hwsim_utils.test_connectivity(dev[0], hapd)
         dev[0].request("REMOVE_NETWORK all")
         dev[0].wait_disconnected()
         dev[0].dump_monitor()
+        hapd.dump_monitor()
 
 def test_owe_pmksa_caching(dev, apdev):
     """Opportunistic Wireless Encryption and PMKSA caching"""
@@ -150,10 +152,12 @@ def test_owe_and_psk(dev, apdev):
 
     dev[0].scan_for_bss(bssid, freq="2412")
     dev[0].connect("owe+psk", psk="12345678")
+    hapd.wait_sta()
     hwsim_utils.test_connectivity(dev[0], hapd)
 
     dev[1].scan_for_bss(bssid, freq="2412")
     dev[1].connect("owe+psk", key_mgmt="OWE")
+    hapd.wait_sta()
     hwsim_utils.test_connectivity(dev[1], hapd)
 
 def test_owe_transition_mode(dev, apdev):
@@ -217,6 +221,7 @@ def run_owe_transition_mode(dev, apdev, adv_bssid0=None, adv_bssid1=None):
 
     id = dev[0].connect("owe-test", key_mgmt="OWE", ieee80211w="2",
                         scan_freq="2412")
+    hapd.wait_sta()
     hwsim_utils.test_connectivity(dev[0], hapd)
     val = dev[0].get_status_field("key_mgmt")
     if val != "OWE":
@@ -239,6 +244,7 @@ def run_owe_transition_mode(dev, apdev, adv_bssid0=None, adv_bssid1=None):
     dev[0].scan_for_bss(bssid, freq="2412")
     dev[0].select_network(id, 2412)
     dev[0].wait_connected()
+    hapd.wait_sta()
     hwsim_utils.test_connectivity(dev[0], hapd)
 
 def test_owe_transition_mode_ifname(dev, apdev):