From 2e0751b2b45f10dca43869164b79b86aea7782d3 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 14 Dec 2023 12:54:10 +0200 Subject: [PATCH] tests: Avoid race condition in ap_pmf_assoc_comeback_wps This needs similar waits on hostapd as ap_pmf_assoc_comeback. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_pmf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/hwsim/test_ap_pmf.py b/tests/hwsim/test_ap_pmf.py index 0b48abcba..d683cf245 100644 --- a/tests/hwsim/test_ap_pmf.py +++ b/tests/hwsim/test_ap_pmf.py @@ -329,11 +329,16 @@ def test_ap_pmf_assoc_comeback_wps(dev, apdev): dev[0].connect(ssid, psk="12345678", ieee80211w="1", key_mgmt="WPA-PSK WPA-PSK-SHA256", proto="WPA2", scan_freq="2412") + hapd.wait_sta(wait_4way_hs=True) hapd.set("ext_mgmt_frame_handling", "1") dev[0].request("DISCONNECT") dev[0].wait_disconnected(timeout=10) + ev = hapd.wait_event(["MGMT-RX"], timeout=1) + if ev is None: + raise Exception("Deauthentication frame RX not reported") hapd.set("ext_mgmt_frame_handling", "0") dev[0].wps_reg(apdev[0]['bssid'], appin) + hapd.wait_4way_hs() if wt.get_sta_counter("assocresp_comeback", apdev[0]['bssid'], dev[0].p2p_interface_addr()) < 1: raise Exception("AP did not use association comeback request")