From: Jouni Malinen Date: Mon, 14 Feb 2022 22:18:07 +0000 (+0200) Subject: tests: Make GAS/ANQP test cases more robust X-Git-Tag: hostap_2_11~2238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5ce9111c5993945ebd428e3736a9e66b5f08e49;p=thirdparty%2Fhostap.git tests: Make GAS/ANQP test cases more robust 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 --- diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index cb4a1a8d6..5a364975a 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -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")