]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make GAS/ANQP test cases more robust
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 14 Feb 2022 22:18:07 +0000 (00:18 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 14 Feb 2022 22:18:07 +0000 (00:18 +0200)
Flush the scan cache for all test cases that used get_bss() to check for
particular ANQP information. This was already done for one such case
based on commit dd900637b2d0 ("tests: Make gas_anqp_extra_elements more
robust"), but other test cases need this as well.

This was showing with frequent errors in test cases sequences like this
one:
dfs_radar_no_ht gas_fragment_with_comeback_delay gas_unknown_adv_proto gas_anqp_venue_url

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_gas.py

index cb4a1a8d6656fc1ff271d4feb84ea57e7656ed65..5a364975a69023bfab23bdeb3d2acd7ecc93ab96 100644 (file)
@@ -1641,6 +1641,7 @@ def test_gas_anqp_venue_url(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
     bssid = apdev[0]['bssid']
 
+    dev[0].flush_scan_cache()
     dev[0].scan_for_bss(bssid, freq="2412", force_scan=True)
     if "OK" not in dev[0].request("ANQP_GET " + bssid + " 257,258,277"):
         raise Exception("ANQP_GET command failed")
@@ -1703,6 +1704,7 @@ def test_gas_anqp_venue_url2(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
     bssid = apdev[0]['bssid']
 
+    dev[0].flush_scan_cache()
     dev[0].scan_for_bss(bssid, freq="2412", force_scan=True)
     if "OK" not in dev[0].request("ANQP_GET " + bssid + " 257,258,277"):
         raise Exception("ANQP_GET command failed")
@@ -1759,6 +1761,7 @@ def test_gas_anqp_venue_url_pmf(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
     bssid = apdev[0]['bssid']
 
+    dev[0].flush_scan_cache()
     dev[0].connect("gas/anqp/pmf", psk="12345678", ieee80211w="2",
                    scan_freq="2412")
     if "OK" not in dev[0].request("ANQP_GET " + bssid + " 277"):
@@ -1799,6 +1802,7 @@ def test_gas_anqp_capab_list(dev, apdev):
     hapd = hostapd.add_ap(apdev[0], params)
     bssid = apdev[0]['bssid']
 
+    dev[0].flush_scan_cache()
     dev[0].scan_for_bss(bssid, freq="2412", force_scan=True)
     if "OK" not in dev[0].request("ANQP_GET " + bssid + " 257"):
         raise Exception("ANQP_GET command failed")