tests: Wait for request before responding in dscp_response
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>
This commit is contained in:
parent
b859b9bcea
commit
d2ce1b4d6c
1 changed files with 5 additions and 0 deletions
|
@ -340,6 +340,11 @@ def test_dscp_response(dev, apdev):
|
||||||
qos_ie += ie
|
qos_ie += ie
|
||||||
send_dscp_req(hapd, da, 1, dialog_token, 0, qos_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"
|
cmd = "DSCP_RESP solicited policy_id=1 status=0 policy_id=4 status=0"
|
||||||
if "OK" not in dev[0].request(cmd):
|
if "OK" not in dev[0].request(cmd):
|
||||||
raise Exception("Sending DSCP Response failed")
|
raise Exception("Sending DSCP Response failed")
|
||||||
|
|
Loading…
Reference in a new issue