tests: Make tests using multi_check() more robust

It was possible for a cached scan entry in cfg80211 from an earlier test
case to show up while verifying that the disabled AP does not show up in
scan results. This could result in invalid test failures, e.g., when
running test cases "ap_require_ht ap_multi_bss_config" multiple times
(depends a bit on timing). Make this less likely to occur by explicitly
clearing the scan cache and by stopping wlan1 from trying to associate
before stopping ap_required_ht* test cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-12-04 21:03:43 +02:00 committed by Jouni Malinen
parent e007d538cd
commit f98b0e5806
2 changed files with 7 additions and 0 deletions

View file

@ -90,6 +90,7 @@ def test_ap_bss_add_remove(dev, apdev):
def _test_ap_bss_add_remove(dev, apdev): def _test_ap_bss_add_remove(dev, apdev):
for i in range(3): for i in range(3):
dev[i].flush_scan_cache()
dev[i].request("SCAN_INTERVAL 1") dev[i].request("SCAN_INTERVAL 1")
ifname1 = apdev[0]['ifname'] ifname1 = apdev[0]['ifname']
ifname2 = apdev[0]['ifname'] + '-2' ifname2 = apdev[0]['ifname'] + '-2'
@ -152,6 +153,8 @@ def _test_ap_bss_add_remove(dev, apdev):
def test_ap_bss_add_remove_during_ht_scan(dev, apdev): def test_ap_bss_add_remove_during_ht_scan(dev, apdev):
"""Dynamic BSS add during HT40 co-ex scan""" """Dynamic BSS add during HT40 co-ex scan"""
for i in range(3):
dev[i].flush_scan_cache()
ifname1 = apdev[0]['ifname'] ifname1 = apdev[0]['ifname']
ifname2 = apdev[0]['ifname'] + '-2' ifname2 = apdev[0]['ifname'] + '-2'
hostapd.add_bss('phy3', ifname1, 'bss-ht40-1.conf') hostapd.add_bss('phy3', ifname1, 'bss-ht40-1.conf')
@ -173,6 +176,8 @@ def test_ap_bss_add_remove_during_ht_scan(dev, apdev):
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 i in range(3):
dev[i].flush_scan_cache()
ifname1 = apdev[0]['ifname'] ifname1 = apdev[0]['ifname']
ifname2 = apdev[0]['ifname'] + '-2' ifname2 = apdev[0]['ifname'] + '-2'
ifname3 = apdev[0]['ifname'] + '-3' ifname3 = apdev[0]['ifname'] + '-3'

View file

@ -768,6 +768,7 @@ def test_ap_require_ht(dev, apdev):
disable_ht="1", wait_connect=False) disable_ht="1", wait_connect=False)
dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412") dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"]) ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
dev[1].request("DISCONNECT")
if ev is None: if ev is None:
raise Exception("Association rejection timed out") raise Exception("Association rejection timed out")
if "status_code=27" not in ev: if "status_code=27" not in ev:
@ -789,6 +790,7 @@ def test_ap_require_ht_limited_rates(dev, apdev):
disable_ht="1", wait_connect=False) disable_ht="1", wait_connect=False)
dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412") dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"]) ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
dev[1].request("DISCONNECT")
if ev is None: if ev is None:
raise Exception("Association rejection timed out") raise Exception("Association rejection timed out")
if "status_code=27" not in ev: if "status_code=27" not in ev: