]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make tests using multi_check() more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 4 Dec 2015 19:03:43 +0000 (21:03 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 4 Dec 2015 19:03:43 +0000 (21:03 +0200)
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>
tests/hwsim/test_ap_dynamic.py
tests/hwsim/test_ap_ht.py

index 19eb9c43d030b654347bdbebc61bc2f1e6954baf..ca418dc05582a09e978f8ea15fe79d529ed9473e 100644 (file)
@@ -90,6 +90,7 @@ def test_ap_bss_add_remove(dev, apdev):
 
 def _test_ap_bss_add_remove(dev, apdev):
     for i in range(3):
+        dev[i].flush_scan_cache()
         dev[i].request("SCAN_INTERVAL 1")
     ifname1 = apdev[0]['ifname']
     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):
     """Dynamic BSS add during HT40 co-ex scan"""
+    for i in range(3):
+        dev[i].flush_scan_cache()
     ifname1 = apdev[0]['ifname']
     ifname2 = apdev[0]['ifname'] + '-2'
     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):
     """hostapd start with a multi-BSS configuration file"""
+    for i in range(3):
+        dev[i].flush_scan_cache()
     ifname1 = apdev[0]['ifname']
     ifname2 = apdev[0]['ifname'] + '-2'
     ifname3 = apdev[0]['ifname'] + '-3'
index 8a8aa9f98d5ebe9ff7d0d374ddfac073d10949ee..001e7224a14ed92a191f2af5e16b46ef86dad806 100644 (file)
@@ -768,6 +768,7 @@ def test_ap_require_ht(dev, apdev):
                    disable_ht="1", wait_connect=False)
     dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
     ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+    dev[1].request("DISCONNECT")
     if ev is None:
         raise Exception("Association rejection timed out")
     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)
     dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
     ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+    dev[1].request("DISCONNECT")
     if ev is None:
         raise Exception("Association rejection timed out")
     if "status_code=27" not in ev: