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>
This commit is contained in:
Jouni Malinen 2014-04-04 23:13:49 +03:00
parent 204c9ac4ee
commit ca4fd18290
2 changed files with 7 additions and 3 deletions

View file

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

View file

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