Browse Source

tests: Speed up IBSS test using single channel scan on SELECT_NETWORK

This removes unnecessary waits and adds test coverage for SELECT_NETWORK
freq parameter.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
ca4fd18290
2 changed files with 7 additions and 3 deletions
  1. 1 1
      tests/hwsim/test_ibss.py
  2. 6 2
      tests/hwsim/wpasupplicant.py

+ 1 - 1
tests/hwsim/test_ibss.py

@@ -13,7 +13,7 @@ import hwsim_utils
 
 def connect_ibss_cmd(dev, id):
     dev.dump_monitor()
-    dev.select_network(id)
+    dev.select_network(id, freq="2412")
 
 def wait_ibss_connection(dev):
     logger.info(dev.ifname + " waiting for IBSS start/join to complete")

+ 6 - 2
tests/hwsim/wpasupplicant.py

@@ -231,8 +231,12 @@ class WpaSupplicant:
 
         return id;
 
-    def select_network(self, id):
-        id = self.request("SELECT_NETWORK " + str(id))
+    def select_network(self, id, freq=None):
+        if freq:
+            extra = " freq=" + freq
+        else:
+            extra = ""
+        id = self.request("SELECT_NETWORK " + str(id) + extra)
         if "FAIL" in id:
             raise Exception("SELECT_NETWORK failed")
         return None