From: Jouni Malinen Date: Sat, 12 Apr 2014 16:43:24 +0000 (+0300) Subject: tests: filter_ssids=1 X-Git-Tag: hostap_2_2~295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=167d8497451fde8534b3ebf0d2aed35bad76b50d;p=thirdparty%2Fhostap.git tests: filter_ssids=1 Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index e30a2d25e..f11cdbdee 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -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")