tests: Redesign bgscan_*_scan_failure to work with implementation change
Wait for allocation failure using wait_fail_trigger() instead of waiting for a scan failure event since that failure event will go away with implementation change. Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
77785da667
commit
909361e28e
1 changed files with 3 additions and 7 deletions
|
@ -10,7 +10,7 @@ logger = logging.getLogger()
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import hostapd
|
import hostapd
|
||||||
from utils import alloc_fail, fail_test
|
from utils import alloc_fail, fail_test, wait_fail_trigger
|
||||||
|
|
||||||
def test_bgscan_simple(dev, apdev):
|
def test_bgscan_simple(dev, apdev):
|
||||||
"""bgscan_simple"""
|
"""bgscan_simple"""
|
||||||
|
@ -99,9 +99,7 @@ def test_bgscan_simple_scan_failure(dev, apdev):
|
||||||
bgscan="simple:1:-20:2")
|
bgscan="simple:1:-20:2")
|
||||||
with alloc_fail(dev[0], 1,
|
with alloc_fail(dev[0], 1,
|
||||||
"wpa_supplicant_trigger_scan;bgscan_simple_timeout"):
|
"wpa_supplicant_trigger_scan;bgscan_simple_timeout"):
|
||||||
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=10)
|
wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")
|
||||||
if ev is None:
|
|
||||||
raise Exception("No scan failure reported")
|
|
||||||
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 10)
|
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 10)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Scanning not continued after failure")
|
raise Exception("Scanning not continued after failure")
|
||||||
|
@ -274,9 +272,7 @@ def test_bgscan_learn_scan_failure(dev, apdev):
|
||||||
bgscan="learn:1:-20:2")
|
bgscan="learn:1:-20:2")
|
||||||
with alloc_fail(dev[0], 1,
|
with alloc_fail(dev[0], 1,
|
||||||
"wpa_supplicant_trigger_scan;bgscan_learn_timeout"):
|
"wpa_supplicant_trigger_scan;bgscan_learn_timeout"):
|
||||||
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=10)
|
wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")
|
||||||
if ev is None:
|
|
||||||
raise Exception("No scan failure reported")
|
|
||||||
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 10)
|
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 10)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Scanning not continued after failure")
|
raise Exception("Scanning not continued after failure")
|
||||||
|
|
Loading…
Reference in a new issue