From 0589f40146128f413d7de9bb647aaaf5af096cee Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 25 Dec 2013 20:17:32 +0200 Subject: [PATCH] tests: Use a single channel scan to avoid unnecessary full scans Signed-hostap: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 12 ++++++------ tests/hwsim/wpasupplicant.py | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 06985d8c3..a83cee69b 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -160,7 +160,7 @@ def test_ap_interworking_scan_filtering(dev, apdev): logger.info("Check probe request filtering based on HESSID") dev[0].request("SET hessid " + bssid2) - dev[0].scan() + dev[0].scan(freq="2412") check_probe_resp(wt, bssid, bssid2) logger.info("Check probe request filtering based on access network type") @@ -169,14 +169,14 @@ def test_ap_interworking_scan_filtering(dev, apdev): wt.clear_bss_counters(bssid2) dev[0].request("SET hessid 00:00:00:00:00:00") dev[0].request("SET access_network_type 14") - dev[0].scan() + dev[0].scan(freq="2412") check_probe_resp(wt, bssid2, bssid) wt.clear_bss_counters(bssid) wt.clear_bss_counters(bssid2) dev[0].request("SET hessid 00:00:00:00:00:00") dev[0].request("SET access_network_type 1") - dev[0].scan() + dev[0].scan(freq="2412") check_probe_resp(wt, bssid, bssid2) logger.info("Check probe request filtering based on HESSID and ANT") @@ -185,14 +185,14 @@ def test_ap_interworking_scan_filtering(dev, apdev): wt.clear_bss_counters(bssid2) dev[0].request("SET hessid " + bssid) dev[0].request("SET access_network_type 14") - dev[0].scan() + dev[0].scan(freq="2412") check_probe_resp(wt, bssid2, bssid) wt.clear_bss_counters(bssid) wt.clear_bss_counters(bssid2) dev[0].request("SET hessid " + bssid2) dev[0].request("SET access_network_type 14") - dev[0].scan() + dev[0].scan(freq="2412") check_probe_resp(wt, bssid, None) check_probe_resp(wt, bssid2, None) @@ -200,7 +200,7 @@ def test_ap_interworking_scan_filtering(dev, apdev): wt.clear_bss_counters(bssid2) dev[0].request("SET hessid " + bssid) dev[0].request("SET access_network_type 1") - dev[0].scan() + dev[0].scan(freq="2412") check_probe_resp(wt, bssid, None) check_probe_resp(wt, bssid2, None) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index af9127786..04ea58602 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -582,11 +582,13 @@ class WpaSupplicant: self.select_network(id) return id - def scan(self, type=None): + def scan(self, type=None, freq=None): if type: cmd = "SCAN TYPE=" + type else: cmd = "SCAN" + if freq: + cmd = cmd + " freq=" + freq self.dump_monitor() if not "OK" in self.request(cmd): raise Exception("Failed to trigger scan")