]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Wait for request before responding in dscp_response
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 9 May 2022 08:45:33 +0000 (11:45 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 9 May 2022 08:45:33 +0000 (11:45 +0300)
There was a possible race condition here between the hostapd request
transmission and wpa_supplicant response command. Wait for the
wpa_supplicant event that indicates reception of the request before
issuing the DSCP_RESP command to avoid failures.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_dscp.py

index e017938bc355d2420008156c2e5590a1b8368958..7e75e56e37c459980b8e19be918771ba8015c7e5 100644 (file)
@@ -340,6 +340,11 @@ def test_dscp_response(dev, apdev):
     qos_ie += ie
     send_dscp_req(hapd, da, 1, dialog_token, 0, qos_ie)
 
+    ev = dev[0].wait_event(["CTRL-EVENT-DSCP-POLICY"], timeout=5)
+    if ev is None:
+        raise Exception("DSCP event not reported")
+    if "request_start" not in ev:
+        raise Exception("Unexpected DSCP event: " + ev)
     cmd = "DSCP_RESP solicited policy_id=1 status=0 policy_id=4 status=0"
     if "OK" not in dev[0].request(cmd):
         raise Exception("Sending DSCP Response failed")