]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Wait for AP side connection event before disconnecting
authorJouni Malinen <jouni@codeaurora.org>
Mon, 5 Aug 2019 10:47:08 +0000 (13:47 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 5 Aug 2019 10:47:08 +0000 (13:47 +0300)
This makes the test cases more robust especially when testing with UML
time travel.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_suite_b.py

index e87378624e8c66c6752b5a8fee80207c45f9dfab..f619472512c55426cdcaf525d971f8c32a1fb875 100644 (file)
@@ -68,6 +68,7 @@ def test_suite_b(dev, apdev):
                    client_cert="auth_serv/ec-user.pem",
                    private_key="auth_serv/ec-user.key",
                    pairwise="GCMP", group="GCMP", scan_freq="2412")
+    hapd.wait_sta()
     tls_cipher = dev[0].get_status_field("EAP TLS cipher")
     if tls_cipher != "ECDHE-ECDSA-AES128-GCM-SHA256" and \
        tls_cipher != "ECDHE-ECDSA-AES-128-GCM-AEAD":
@@ -94,6 +95,7 @@ def test_suite_b(dev, apdev):
     if conf['key_mgmt'] != 'WPA-EAP-SUITE-B':
         raise Exception("Unexpected config key_mgmt: " + conf['key_mgmt'])
 
+    hapd.wait_sta()
     dev[0].request("DISCONNECT")
     dev[0].wait_disconnected(timeout=20)
     dev[0].dump_monitor()
@@ -201,6 +203,7 @@ def test_suite_b_192(dev, apdev):
     if "[WPA2-EAP-SUITE-B-192-GCMP-256]" not in bss['flags']:
         raise Exception("Unexpected BSS flags: " + bss['flags'])
 
+    hapd.wait_sta()
     dev[0].request("DISCONNECT")
     dev[0].wait_disconnected(timeout=20)
     dev[0].dump_monitor()
@@ -216,6 +219,7 @@ def test_suite_b_192(dev, apdev):
     if conf['key_mgmt'] != 'WPA-EAP-SUITE-B-192':
         raise Exception("Unexpected config key_mgmt: " + conf['key_mgmt'])
 
+    hapd.wait_sta()
     dev[0].request("DISCONNECT")
     dev[0].wait_disconnected(timeout=20)
     dev[0].dump_monitor()
@@ -437,6 +441,7 @@ def run_suite_b_192_rsa(dev, apdev, no_ecdh=False, no_dhe=False):
     if "[WPA2-EAP-SUITE-B-192-GCMP-256]" not in bss['flags']:
         raise Exception("Unexpected BSS flags: " + bss['flags'])
 
+    hapd.wait_sta()
     dev[0].request("DISCONNECT")
     dev[0].wait_disconnected(timeout=20)
     dev[0].dump_monitor()