From: Jouni Malinen Date: Sun, 17 Dec 2023 11:52:42 +0000 (+0200) Subject: tests: Avoid race condition in autogo_passphrase_len X-Git-Tag: hostap_2_11~638 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52e869032ab0eedce0a15590357e967830e36230;p=thirdparty%2Fhostap.git tests: Avoid race condition in autogo_passphrase_len Wait for 4-way handshake to complete on the GO before the connectivity test between two P2P clients. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py index b8235a562..d020336f6 100644 --- a/tests/hwsim/test_p2p_autogo.py +++ b/tests/hwsim/test_p2p_autogo.py @@ -459,6 +459,11 @@ def test_autogo_passphrase_len(dev): key_mgmt='WPA-PSK', pairwise='CCMP', group='CCMP', scan_freq=res['freq']) dev[0].wait_sta(addr=dev[2].own_addr()) + ev = dev[0].wait_group_event(["EAPOL-4WAY-HS-COMPLETED"], timeout=5) + if ev is None: + raise Exception("4-way handshake was not completed") + if dev[2].own_addr() not in ev: + raise Exception("Unexpected 4-way handshake address: " + ev) hwsim_utils.test_connectivity_p2p_sta(dev[1], dev[2]) dev[2].request("DISCONNECT")