From: Jouni Malinen Date: Tue, 31 Oct 2023 09:54:40 +0000 (+0200) Subject: tests: Redesign bgscan_*_scan_failure to work with implementation change X-Git-Tag: hostap_2_11~894 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=909361e28eb87e66914ebdc84284235359c4554f;p=thirdparty%2Fhostap.git 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 --- diff --git a/tests/hwsim/test_bgscan.py b/tests/hwsim/test_bgscan.py index e3c1790ba..a3daa06ca 100644 --- a/tests/hwsim/test_bgscan.py +++ b/tests/hwsim/test_bgscan.py @@ -10,7 +10,7 @@ logger = logging.getLogger() import os 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): """bgscan_simple""" @@ -99,9 +99,7 @@ def test_bgscan_simple_scan_failure(dev, apdev): bgscan="simple:1:-20:2") with alloc_fail(dev[0], 1, "wpa_supplicant_trigger_scan;bgscan_simple_timeout"): - ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=10) - if ev is None: - raise Exception("No scan failure reported") + wait_fail_trigger(dev[0], "GET_ALLOC_FAIL") ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 10) if ev is None: raise Exception("Scanning not continued after failure") @@ -274,9 +272,7 @@ def test_bgscan_learn_scan_failure(dev, apdev): bgscan="learn:1:-20:2") with alloc_fail(dev[0], 1, "wpa_supplicant_trigger_scan;bgscan_learn_timeout"): - ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=10) - if ev is None: - raise Exception("No scan failure reported") + wait_fail_trigger(dev[0], "GET_ALLOC_FAIL") ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 10) if ev is None: raise Exception("Scanning not continued after failure")