From: Jouni Malinen Date: Thu, 15 May 2014 18:10:52 +0000 (+0300) Subject: tests: Verify scan behavior when interface gets disabled X-Git-Tag: hostap_2_2~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23a6d4d8df0eda044b1487311604c2aa8a1fe1e4;p=thirdparty%2Fhostap.git tests: Verify scan behavior when interface gets disabled Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index 928352c4d..9ad51599b 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -251,3 +251,24 @@ def test_scan_bss_operations(dev, apdev): raise Exception("Unexpected RANGE=2-10 result") if len(dev[0].request("BSS RANGE=0-" + str(int(id2) + 10) + " MASK=0x1").splitlines()) != 2: raise Exception("Unexpected RANGE=0-10 result") + +def test_scan_and_interface_disabled(dev, apdev): + """Scan operation when interface gets disabled""" + try: + dev[0].request("SCAN") + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"]) + if ev is None: + raise Exception("Scan did not start") + dev[0].request("DRIVER_EVENT INTERFACE_DISABLED") + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=7) + if ev is not None: + raise Exception("Scan completed unexpectedly") + + # verify that scan is rejected + if "FAIL" not in dev[0].request("SCAN"): + raise Exception("New scan request was accepted unexpectedly") + + dev[0].request("DRIVER_EVENT INTERFACE_ENABLED") + dev[0].scan(freq="2412") + finally: + dev[0].request("DRIVER_EVENT INTERFACE_ENABLED")