Browse Source

tests: Use a single channel scan to avoid unnecessary full scans

Signed-hostap: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
0589f40146
2 changed files with 9 additions and 7 deletions
  1. 6 6
      tests/hwsim/test_ap_hs20.py
  2. 3 1
      tests/hwsim/wpasupplicant.py

+ 6 - 6
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)
 

+ 3 - 1
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")