]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: ap_open_poll_sta_no_ack: Fix mgmt-rx race
authorJohannes Berg <johannes.berg@intel.com>
Mon, 25 Sep 2023 07:20:55 +0000 (09:20 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 28 Oct 2023 09:34:57 +0000 (12:34 +0300)
We need to wait for the MGMT-RX event before disabling
ext_mgmt_frame_handling again, otherwise we might be disabling it and
hostapd only receives the deauth frame after we already disable it,
defeating the purpose of the test.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
tests/hwsim/test_ap_open.py

index a3bea763a1c4983d5d3d759352261bebf42447aa..beb0e18187b5d4430c5fdf5588016cc52f22cc50 100644 (file)
@@ -725,6 +725,9 @@ def test_ap_open_poll_sta_no_ack(dev, apdev):
     hapd.set("ext_mgmt_frame_handling", "1")
     dev[0].request("DISCONNECT")
     dev[0].wait_disconnected()
+    # eat up the deauth frame, so it cannot be processed
+    # after we disable ext_mgmt_frame_handling again
+    hapd.wait_event(["MGMT-RX"], timeout=1)
     hapd.set("ext_mgmt_frame_handling", "0")
     if "OK" not in hapd.request("POLL_STA " + addr):
         raise Exception("POLL_STA failed")