]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make PASN tests more robust
authorJouni Malinen <j@w1.fi>
Sat, 20 Feb 2021 13:45:54 +0000 (15:45 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 20 Feb 2021 13:45:54 +0000 (15:45 +0200)
The PASN_START command can fail if there is an old BSS entry for the
same BSSID from an earlier test case. Try to avoid this by flushing the
scan results before running these test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_pasn.py

index 157d159550746de57890dd89968fef0da5aa5577..3ee8cf52a639fc9136386579083ffc5a3e64c613 100644 (file)
@@ -61,6 +61,7 @@ def check_pasn_ptk(dev, hapd, cipher):
 
 def check_pasn_akmp_cipher(dev, hapd, akmp="PASN", cipher="CCMP",
                            group="19", status=0, fail=0, nid=""):
+    dev.flush_scan_cache()
     dev.scan(type="ONLY", freq=2412)
 
     cmd = "PASN_START bssid=%s akmp=%s cipher=%s group=%s" % (hapd.own_addr(), akmp, cipher, group)
@@ -441,6 +442,8 @@ def pasn_fils_setup(wpas, apdev, params, key_mgmt):
     check_fils_capa(wpas)
     check_erp_capa(wpas)
 
+    wpas.flush_scan_cache()
+
     start_erp_as(msk_dump=os.path.join(params['logdir'], "msk.lst"))
 
     bssid = apdev[0]['bssid']