tests: Abort scan

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>
This commit is contained in:
Jouni Malinen 2015-10-27 11:06:14 +02:00 committed by Jouni Malinen
parent 2ea2166d5a
commit 7767687109

View 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")