From 52e869032ab0eedce0a15590357e967830e36230 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 17 Dec 2023 13:52:42 +0200 Subject: [PATCH] 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 --- tests/hwsim/test_p2p_autogo.py | 5 +++++ 1 file changed, 5 insertions(+) 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")