tests: Remove unnecessary second wait from connect_cmd_reject_assoc

It does not look like there would be two CTRL-EVENT-ASSOC-REJECT events
here, so only check the first one instead of requiring both to be
received with status_code=27. This test case could fail based on the
second connection attempt (due to that extra event wait) timing out.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-03-15 22:42:18 +02:00 committed by Jouni Malinen
parent a2d300765b
commit 649038e117

View file

@ -130,14 +130,11 @@ def test_connect_cmd_reject_assoc(dev, apdev):
wpas.interface_add("wlan5", drv_params="force_connect_cmd=1") wpas.interface_add("wlan5", drv_params="force_connect_cmd=1")
wpas.connect("sta-connect", key_mgmt="NONE", scan_freq="2412", wpas.connect("sta-connect", key_mgmt="NONE", scan_freq="2412",
disable_ht="1", wait_connect=False) disable_ht="1", wait_connect=False)
# Reject event gets reported twice since we force connect command to be used ev = wpas.wait_event(["CTRL-EVENT-ASSOC-REJECT"], timeout=15)
# with a driver that supports auth+assoc for testing purposes. if ev is None:
for i in range(0, 2): raise Exception("Association rejection timed out")
ev = wpas.wait_event(["CTRL-EVENT-ASSOC-REJECT"], timeout=15) if "status_code=27" not in ev:
if ev is None: raise Exception("Unexpected rejection status code")
raise Exception("Association rejection timed out")
if "status_code=27" not in ev:
raise Exception("Unexpected rejection status code")
wpas.request("DISCONNECT") wpas.request("DISCONNECT")
wpas.dump_monitor() wpas.dump_monitor()