From f13de00b89e1b65d0ab552b21d07970534c1e723 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 5 Aug 2019 13:47:08 +0300 Subject: [PATCH] tests: Wait for AP side connection event before disconnecting This makes the test cases more robust especially when testing with UML time travel. Signed-off-by: Jouni Malinen --- tests/hwsim/test_suite_b.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/hwsim/test_suite_b.py b/tests/hwsim/test_suite_b.py index e87378624..f61947251 100644 --- a/tests/hwsim/test_suite_b.py +++ b/tests/hwsim/test_suite_b.py @@ -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()