]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Ongoing scan and FLUSH
authorJouni Malinen <j@w1.fi>
Sat, 10 Dec 2016 17:03:07 +0000 (19:03 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Dec 2016 10:45:08 +0000 (12:45 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_scan.py

index 8dbfdcc926c9e45cdfe95d019db88fd1860d5437..761520abaf42dcb54d63015f722cb996f71dcfe5 100644 (file)
@@ -1262,3 +1262,22 @@ def _test_scan_new_only(dev, apdev):
             idx = bss['update_idx']
             if int(idx) > int(idx2):
                 raise Exception("Unexpected update_idx increase")
+
+def test_scan_flush(dev, apdev):
+    """Ongoing scan and FLUSH"""
+    dev[0].flush_scan_cache()
+    hapd = hostapd.add_ap(apdev[0], { "ssid": "test-scan" })
+    dev[0].dump_monitor()
+    dev[0].request("SCAN TYPE=ONLY freq=2412-2472 passive=1")
+    ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=10)
+    if ev is None:
+        raise Exception("Scan did not start")
+    time.sleep(0.1)
+    dev[0].request("FLUSH")
+    ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS",
+                            "CTRL-EVENT-SCAN-FAILED",
+                            "CTRL-EVENT-BSS-ADDED"], timeout=10)
+    if ev is None:
+        raise Exception("Scan did not complete")
+    if "CTRL-EVENT-BSS-ADDED" in ev:
+        raise Exception("Unexpected BSS entry addition after FLUSH")