]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: SCAN scan_id
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 1 Jul 2014 20:57:57 +0000 (23:57 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 2 Jul 2014 09:52:08 +0000 (12:52 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_scan.py

index 25de1283278c8310c6a4862c398a3705871c890b..bb6edcc9a58027f49079df5f79e2590982d96c0f 100644 (file)
@@ -298,3 +298,27 @@ def test_scan_for_auth(dev, apdev):
     ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
     if ev is None:
         raise Exception("Association with the AP timed out")
+
+def test_scan_hidden(dev, apdev):
+    """Control interface behavior on scan parameters"""
+    hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan",
+                                         "ignore_broadcast_ssid": "1" })
+    bssid = apdev[0]['bssid']
+
+    check_scan(dev[0], "freq=2412 use_id=1")
+    if "test-scan" in dev[0].request("SCAN_RESULTS"):
+        raise Exception("BSS unexpectedly found in initial scan")
+
+    id1 = dev[0].connect("foo", key_mgmt="NONE", scan_ssid="1",
+                         only_add_network=True)
+    id2 = dev[0].connect("test-scan", key_mgmt="NONE", scan_ssid="1",
+                         only_add_network=True)
+    id3 = dev[0].connect("bar", key_mgmt="NONE", only_add_network=True)
+
+    check_scan(dev[0], "freq=2412 use_id=1")
+    if "test-scan" in dev[0].request("SCAN_RESULTS"):
+        raise Exception("BSS unexpectedly found in scan")
+
+    check_scan(dev[0], "scan_id=%d,%d,%d freq=2412 use_id=1" % (id1, id2, id3))
+    if "test-scan" not in dev[0].request("SCAN_RESULTS"):
+        raise Exception("BSS not found in scan")