]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Abort scan
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 27 Oct 2015 09:06:14 +0000 (11:06 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 26 Nov 2015 17:44:14 +0000 (19:44 +0200)
This verifies the nl80211 behavior to abort a scan on an explicit
control interface request and on connection request.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_scan.py

index 2fd1423e952869421ef362f25fd9355864241df6..bb96033ae05013701feba6ab506dbcdfa1abbfd1 100644 (file)
@@ -946,3 +946,28 @@ def _test_scan_dfs(dev, apdev, params):
             f = int(ff)
             if (f >= 5260 and f <= 5320) or (f >= 5500 and f <= 5700):
                 raise Exception("Active scan on DFS channel: %d" % f)
+
+def test_scan_abort(dev, apdev):
+    """Aborting a full scan"""
+    dev[0].request("SCAN")
+    ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"])
+    if ev is None:
+        raise Exception("Scan did not start")
+    if "OK" not in dev[0].request("ABORT_SCAN"):
+        raise Exception("ABORT_SCAN command failed")
+    ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=2)
+    if ev is None:
+        raise Exception("Scan did not terminate")
+
+def test_scan_abort_on_connect(dev, apdev):
+    """Aborting a full scan on connection request"""
+    hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan" })
+    bssid = apdev[0]['bssid']
+
+    dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
+    dev[0].dump_monitor()
+    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].connect("test-scan", key_mgmt="NONE")