wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add("wlan5", drv_params="force_connect_cmd=1")
wpas.hs20_enable()
+ wpas.flush_scan_cache()
id = wpas.add_cred_values({ 'realm': "example.com",
'username': "hs20-test",
'password': "password",
wpas.request("SET preassoc_mac_addr 1")
wpas.request("SET rand_addr_lifetime 60")
wpas.hs20_enable()
- wpas.scan(freq="2412", only_new=True)
+ wpas.flush_scan_cache()
id = wpas.add_cred_values({ 'realm': "example.com",
'username': "hs20-test",
'password': "password",
logger.info("Re-configure back to open")
dev[0].request("REMOVE_NETWORK all")
- dev[0].request("BSS_FLUSH 0")
- dev[0].request("SCAN freq=2412 only_new=1")
- ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 15)
- if ev is None:
- raise Exception("Scan timed out")
+ dev[0].flush_scan_cache()
dev[0].dump_monitor()
dev[0].wps_reg(apdev[0]['bssid'], appin, "wps-open", "OPEN", "NONE", "")
status = dev[0].get_status()
def test_go_neg_with_bss_connected(dev, apdev):
"""P2P channel selection: GO negotiation when station interface is connected"""
- dev[0].request("BSS_FLUSH 0")
- dev[0].request("SCAN freq=2412 only_new=1")
- dev[1].request("BSS_FLUSH 0")
- dev[1].request("SCAN freq=2412 only_new=1")
+ dev[0].flush_scan_cache()
+ dev[1].flush_scan_cache()
dev[0].request("SET p2p_no_group_iface 0")
hapd = hostapd.add_ap(apdev[0]['ifname'],
hapd = hostapd.add_ap(apdev[0]['ifname'],
{ "ssid": 'bss-2.4ghz', "channel": '1' })
# make sure PBC overlap from old test cases is not maintained
- dev[0].request("BSS_FLUSH 0")
- dev[0].request("SCAN freq=2412 only_new=1")
- dev[1].request("BSS_FLUSH 0")
- dev[1].request("SCAN freq=2412 only_new=1")
+ dev[0].flush_scan_cache()
+ dev[1].flush_scan_cache()
wpas.connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412")
wpas.request("P2P_SET disallow_freq 2412")
raise Exception("New radio does not support MCC")
# Clear possible PBC session overlap from previous test case
- dev[1].request("BSS_FLUSH 0")
- dev[1].request("SCAN freq=2412 only_new=1")
+ dev[1].flush_scan_cache()
wpas.request("SET p2p_no_group_iface 0")
logger.info("Start connection to an infrastructure AP")
hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-open" })
dev[0].connect("test-open", key_mgmt="NONE", wait_connect=False)
- dev[1].request("BSS_FLUSH 0")
- dev[1].scan(freq="2412", only_new=True)
+ dev[1].flush_scan_cache()
logger.info("Form a P2P group while connecting to an AP")
dev[0].request("SET p2p_no_group_iface 0")
def clear_pbc_overlap(dev, ifname):
hapd_global = hostapd.HostapdGlobal()
hapd_global.remove(ifname)
+ dev[0].request("P2P_CANCEL")
+ dev[1].request("P2P_CANCEL")
dev[0].p2p_stop_find()
dev[1].p2p_stop_find()
dev[0].dump_monitor()
dev[1].dump_monitor()
time.sleep(0.1)
- dev[0].request("BSS_FLUSH 0")
- dev[0].request("SCAN freq=2412 only_new=1")
- dev[1].request("BSS_FLUSH 0")
- dev[1].request("SCAN freq=2412 only_new=1")
- time.sleep(1)
+ dev[0].flush_scan_cache()
+ dev[1].flush_scan_cache()
+ time.sleep(0.1)
def test_grpform_pbc_overlap(dev, apdev):
"""P2P group formation during PBC overlap"""
else:
cmd = "SCAN"
if freq:
- cmd = cmd + " freq=" + freq
+ cmd = cmd + " freq=" + str(freq)
if only_new:
cmd += " only_new=1"
if not no_wait:
return
raise Exception("Could not find BSS " + bssid + " in scan")
+ def flush_scan_cache(self):
+ self.request("BSS_FLUSH 0")
+ self.scan(freq=2412, only_new=True)
+
def roam(self, bssid, fail_test=False):
self.dump_monitor()
if "OK" not in self.request("ROAM " + bssid):