tests: Allow multiple Enrollee events in ap_wps_er_add_enrollee_pbc
It was possible for the AP to report two enrollees in this test case (i.e., both the expected wlan1 device and also the ER device on wlan0). The previous test script would fail if the wlan0 device is reported first. Fix this by allowed the expected target to be found in either the first or the second WPS-ER-ENROLLEE-ADD event. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
d4b21766e5
commit
8674c02244
1 changed files with 9 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# WPS tests
|
||||
# Copyright (c) 2013, Jouni Malinen <j@w1.fi>
|
||||
# Copyright (c) 2013-2014, Jouni Malinen <j@w1.fi>
|
||||
#
|
||||
# This software may be distributed under the terms of the BSD license.
|
||||
# See README for more details.
|
||||
|
@ -705,10 +705,13 @@ def test_ap_wps_er_add_enrollee_pbc(dev, apdev):
|
|||
dev[1].dump_monitor()
|
||||
dev[1].request("WPS_PBC")
|
||||
|
||||
for i in range(0, 2):
|
||||
ev = dev[0].wait_event(["WPS-ER-ENROLLEE-ADD"], timeout=15)
|
||||
if ev is None:
|
||||
raise Exception("Enrollee discovery timed out")
|
||||
if enrollee not in ev:
|
||||
if enrollee in ev:
|
||||
break
|
||||
if i == 1:
|
||||
raise Exception("Expected Enrollee not found")
|
||||
dev[0].request("WPS_ER_PBC " + enrollee)
|
||||
|
||||
|
|
Loading…
Reference in a new issue