tests: Verify BSS additional/removal during HT co-ex scan

This verifies that hostapd can add and remove a secondary BSS
during an ongoing HT co-ex scan.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-11-06 15:52:40 +02:00 committed by Jouni Malinen
parent 5e1a4565f8
commit dd6f538ea5
3 changed files with 53 additions and 5 deletions

View file

@ -0,0 +1,12 @@
driver=nl80211
hw_mode=g
channel=1
ieee80211n=1
ht_capab=[HT40+]
interface=wlan3
bssid=02:00:00:00:03:00
ctrl_interface=/var/run/hostapd
ssid=bss-1

View file

@ -0,0 +1,12 @@
driver=nl80211
hw_mode=g
channel=1
ieee80211n=1
ht_capab=[HT40+]
interface=wlan3-2
bssid=02:00:00:00:03:01
ctrl_interface=/var/run/hostapd
ssid=bss-2

View file

@ -37,27 +37,28 @@ def test_ap_change_ssid(dev, apdev):
def multi_check(dev, check): def multi_check(dev, check):
id = [] 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].request("BSS_FLUSH 0")
dev[i].dump_monitor() dev[i].dump_monitor()
id.append(dev[i].connect("bss-" + str(i + 1), key_mgmt="NONE", id.append(dev[i].connect("bss-" + str(i + 1), key_mgmt="NONE",
scan_freq="2412", wait_connect=check[i])) scan_freq="2412", wait_connect=check[i]))
for i in range(0, 3): for i in range(0, num_bss):
if not check[i]: if not check[i]:
ev = dev[i].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.2) ev = dev[i].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.2)
if ev: if ev:
raise Exception("Unexpected connection") raise Exception("Unexpected connection")
for i in range(0, 3): for i in range(0, num_bss):
dev[i].remove_network(id[i]) dev[i].remove_network(id[i])
time.sleep(0.3) time.sleep(0.3)
res = '' res = ''
for i in range(0, 3): for i in range(0, num_bss):
res = res + dev[i].request("BSS RANGE=ALL MASK=0x2") 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]: if not check[i]:
bssid = '02:00:00:00:03:0' + str(i) bssid = '02:00:00:00:03:0' + str(i)
if bssid in res: if bssid in res:
@ -126,6 +127,29 @@ def test_ap_bss_add_remove(dev, apdev):
hostapd.add_bss('phy3', ifname3, 'bss-3.conf', ignore_error=True) hostapd.add_bss('phy3', ifname3, 'bss-3.conf', ignore_error=True)
multi_check(dev, [ True, True, 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): def test_ap_multi_bss_config(dev, apdev):
"""hostapd start with a multi-BSS configuration file""" """hostapd start with a multi-BSS configuration file"""
for d in dev: for d in dev: