]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: filter_ssids=1
authorJouni Malinen <j@w1.fi>
Sat, 12 Apr 2014 16:43:24 +0000 (19:43 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 13 Apr 2014 07:26:53 +0000 (10:26 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_scan.py

index e30a2d25ed791fdb9ad3c746b28203f2f1f45c25..f11cdbdee9f05cf4112478cde2e345a375d80d4d 100644 (file)
@@ -150,3 +150,21 @@ def test_scan_bss_expiration_age(dev, apdev):
             raise Exception("BSS not removed after expiration time")
     finally:
         dev[0].request("BSS_EXPIRE_AGE 180")
+
+def test_scan_filter(dev, apdev):
+    """Filter scan results based on SSID"""
+    try:
+        if "OK" not in dev[0].request("SET filter_ssids 1"):
+            raise Exception("SET failed")
+        dev[0].connect("test-scan", key_mgmt="NONE", only_add_network=True)
+        hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan" })
+        bssid = apdev[0]['bssid']
+        hostapd.add_ap(apdev[1]['ifname'], { "ssid": "test-scan2" })
+        bssid2 = apdev[1]['bssid']
+        dev[0].scan(freq="2412", only_new=True)
+        if bssid not in dev[0].request("SCAN_RESULTS"):
+            raise Exception("BSS not found in scan results")
+        if bssid2 in dev[0].request("SCAN_RESULTS"):
+            raise Exception("Unexpected BSS found in scan results")
+    finally:
+        dev[0].request("SET filter_ssids 0")