]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Avoid race condition in autogo_passphrase_len
authorJouni Malinen <j@w1.fi>
Sun, 17 Dec 2023 11:52:42 +0000 (13:52 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 17 Dec 2023 11:52:42 +0000 (13:52 +0200)
Wait for 4-way handshake to complete on the GO before the connectivity
test between two P2P clients.

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

index b8235a562b3e3f2225ab93c17a2cbceeb249bcc8..d020336f602fbed097829a0e4af41c106ca65207 100644 (file)
@@ -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")