def multi_check(dev, check):
id = []
- for i in range(0, 3):
+ num_bss = len(check)
+ for i in range(0, num_bss):
dev[i].request("BSS_FLUSH 0")
dev[i].dump_monitor()
id.append(dev[i].connect("bss-" + str(i + 1), key_mgmt="NONE",
scan_freq="2412", wait_connect=check[i]))
- for i in range(0, 3):
+ for i in range(0, num_bss):
if not check[i]:
ev = dev[i].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.2)
if ev:
raise Exception("Unexpected connection")
- for i in range(0, 3):
+ for i in range(0, num_bss):
dev[i].remove_network(id[i])
time.sleep(0.3)
res = ''
- for i in range(0, 3):
+ for i in range(0, num_bss):
res = res + dev[i].request("BSS RANGE=ALL MASK=0x2")
- for i in range(0, 3):
+ for i in range(0, num_bss):
if not check[i]:
bssid = '02:00:00:00:03:0' + str(i)
if bssid in res:
hostapd.add_bss('phy3', ifname3, 'bss-3.conf', ignore_error=True)
multi_check(dev, [ True, True, True ])
+def test_ap_bss_add_remove_during_ht_scan(dev, apdev):
+ """Dynamic BSS add during HT40 co-ex scan"""
+ for d in dev:
+ d.request("SET ignore_old_scan_res 1")
+ ifname1 = apdev[0]['ifname']
+ ifname2 = apdev[0]['ifname'] + '-2'
+ hostapd.add_bss('phy3', ifname1, 'bss-ht40-1.conf')
+ hostapd.add_bss('phy3', ifname2, 'bss-ht40-2.conf')
+ multi_check(dev, [ True, True ])
+ hostapd.remove_bss(ifname2)
+ hostapd.remove_bss(ifname1)
+
+ hostapd.add_bss('phy3', ifname1, 'bss-ht40-1.conf')
+ hostapd.add_bss('phy3', ifname2, 'bss-ht40-2.conf')
+ hostapd.remove_bss(ifname2)
+ multi_check(dev, [ True, False ])
+ hostapd.remove_bss(ifname1)
+
+ hostapd.add_bss('phy3', ifname1, 'bss-ht40-1.conf')
+ hostapd.add_bss('phy3', ifname2, 'bss-ht40-2.conf')
+ hostapd.remove_bss(ifname1)
+ multi_check(dev, [ False, False ])
+
def test_ap_multi_bss_config(dev, apdev):
"""hostapd start with a multi-BSS configuration file"""
for d in dev: