]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify scan behavior when interface gets disabled
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 15 May 2014 18:10:52 +0000 (21:10 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 15 May 2014 18:10:52 +0000 (21:10 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_scan.py

index 928352c4d9a7185a02384eda3bb85777e9c1c3c0..9ad51599b5981806114d753b6b896558d979431d 100644 (file)
@@ -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")