]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Remove ignore_old_scan_res clearing from the test scripts
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 4 Feb 2022 19:29:52 +0000 (21:29 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 4 Feb 2022 19:29:52 +0000 (21:29 +0200)
Now that wpa_supplicant does this internally as a part of the FLUSH
command, there is no need for the test scripts to try to clear the
parameter between test cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_nfc_p2p.py
tests/hwsim/test_nfc_wps.py
tests/hwsim/test_scan.py
tests/hwsim/test_sigma_dut.py
tests/hwsim/utils.py

index 3139dc4d33b4b5804c41c04b87f4dd8e04f01766..8267d745b4286e5b5093f4469a80bbf0553929ca 100644 (file)
@@ -582,13 +582,6 @@ def test_nfc_p2p_static_handover_join_tagdev_go(dev):
 
 def test_nfc_p2p_static_handover_join_tagdev_client(dev):
     """NFC static handover to join a P2P group (NFC Tag device is the P2P Client)"""
-    try:
-        _test_nfc_p2p_static_handover_join_tagdev_client(dev)
-    finally:
-        dev[1].global_request("SET ignore_old_scan_res 0")
-        dev[2].global_request("SET ignore_old_scan_res 0")
-
-def _test_nfc_p2p_static_handover_join_tagdev_client(dev):
     set_ip_addr_info(dev[0])
     logger.info("Start autonomous GO")
     dev[0].p2p_start_go()
index a0e2d454ffe9f4e2b72e954a84bdec99845857b3..6fe4c42a5896a1a8ca9283b65760f6d8a2fddefa 100644 (file)
@@ -219,12 +219,6 @@ def test_nfc_wps_password_token_ap_preconf(dev, apdev):
 def test_nfc_wps_handover_init(dev, apdev):
     """Connect to WPS AP with NFC connection handover and move to configured state"""
     skip_without_tkip(dev[0])
-    try:
-        _test_nfc_wps_handover_init(dev, apdev)
-    finally:
-        dev[0].request("SET ignore_old_scan_res 0")
-
-def _test_nfc_wps_handover_init(dev, apdev):
     dev[0].request("SET ignore_old_scan_res 1")
     ssid = "test-wps-nfc-handover-init"
     hapd = hostapd.add_ap(apdev[0],
@@ -483,11 +477,9 @@ def start_ap_er(er, ap, ssid):
     hapd = hostapd.add_ap(ap, params)
     logger.info("Learn AP configuration")
     er.dump_monitor()
-    try:
-        er.request("SET ignore_old_scan_res 1")
-        er.wps_reg(ap['bssid'], ap_pin)
-    finally:
-        er.request("SET ignore_old_scan_res 0")
+    er.request("SET ignore_old_scan_res 1")
+    er.wps_reg(ap['bssid'], ap_pin)
+    er.request("SET ignore_old_scan_res 0")
 
     logger.info("Start ER")
     er.request("WPS_ER_STOP")
@@ -510,7 +502,6 @@ def test_nfc_wps_er_pw_token(dev, apdev):
         _test_nfc_wps_er_pw_token(dev, apdev)
     finally:
         dev[0].request("WPS_ER_STOP")
-        dev[1].request("SET ignore_old_scan_res 0")
 
 def _test_nfc_wps_er_pw_token(dev, apdev):
     ssid = "wps-nfc-er-pw-token"
@@ -541,7 +532,6 @@ def test_nfc_wps_er_config_token(dev, apdev):
         _test_nfc_wps_er_config_token(dev, apdev)
     finally:
         dev[0].request("WPS_ER_STOP")
-        dev[1].request("SET ignore_old_scan_res 0")
 
 def _test_nfc_wps_er_config_token(dev, apdev):
     ssid = "wps-nfc-er-config-token"
@@ -595,7 +585,6 @@ def test_nfc_wps_er_handover_pk_hash_mismatch_sta(dev, apdev):
         _test_nfc_wps_er_handover_pk_hash_mismatch_sta(dev, apdev)
     finally:
         dev[0].request("WPS_ER_STOP")
-        dev[1].request("SET ignore_old_scan_res 0")
 
 def _test_nfc_wps_er_handover_pk_hash_mismatch_sta(dev, apdev):
     ssid = "wps-nfc-er-handover-pkhash-sta"
@@ -629,7 +618,6 @@ def test_nfc_wps_er_handover_pk_hash_mismatch_er(dev, apdev):
         _test_nfc_wps_er_handover_pk_hash_mismatch_er(dev, apdev)
     finally:
         dev[0].request("WPS_ER_STOP")
-        dev[1].request("SET ignore_old_scan_res 0")
 
 def _test_nfc_wps_er_handover_pk_hash_mismatch_er(dev, apdev):
     ssid = "wps-nfc-er-handover-pkhash-er"
index d97f74f965c68771247765547157fdba649cae80..ccb52dc9e9683542e58b0c53a777c6620700c7b9 100644 (file)
@@ -1286,7 +1286,6 @@ def test_scan_chan_switch(dev, apdev):
     run_scan(dev[0], bssid, 2412)
     dev[0].dump_monitor()
 
-@reset_ignore_old_scan_res
 def test_scan_new_only(dev, apdev):
     """Scan and only_new=1 multiple times"""
     dev[0].flush_scan_cache()
index cccc44f4de9331e0c6a0f609bf172e92a0694b94..0b81e7f56290cff6be0572e92117e25c2cbc294a 100644 (file)
@@ -185,7 +185,6 @@ def test_sigma_dut_basic(dev, apdev):
     finally:
         stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_open(dev, apdev):
     """sigma_dut controlled open network association"""
     ifname = dev[0].ifname
@@ -205,7 +204,6 @@ def test_sigma_dut_open(dev, apdev):
     finally:
         stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_psk_pmf(dev, apdev):
     """sigma_dut controlled PSK+PMF association"""
     ifname = dev[0].ifname
@@ -230,27 +228,22 @@ def test_sigma_dut_psk_pmf(dev, apdev):
     finally:
         stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_psk_pmf_bip_cmac_128(dev, apdev):
     """sigma_dut controlled PSK+PMF association with BIP-CMAC-128"""
     run_sigma_dut_psk_pmf_cipher(dev, apdev, "BIP-CMAC-128", "AES-128-CMAC")
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_psk_pmf_bip_cmac_256(dev, apdev):
     """sigma_dut controlled PSK+PMF association with BIP-CMAC-256"""
     run_sigma_dut_psk_pmf_cipher(dev, apdev, "BIP-CMAC-256", "BIP-CMAC-256")
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_psk_pmf_bip_gmac_128(dev, apdev):
     """sigma_dut controlled PSK+PMF association with BIP-GMAC-128"""
     run_sigma_dut_psk_pmf_cipher(dev, apdev, "BIP-GMAC-128", "BIP-GMAC-128")
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_psk_pmf_bip_gmac_256(dev, apdev):
     """sigma_dut controlled PSK+PMF association with BIP-GMAC-256"""
     run_sigma_dut_psk_pmf_cipher(dev, apdev, "BIP-GMAC-256", "BIP-GMAC-256")
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_psk_pmf_bip_gmac_256_mismatch(dev, apdev):
     """sigma_dut controlled PSK+PMF association with BIP-GMAC-256 mismatch"""
     run_sigma_dut_psk_pmf_cipher(dev, apdev, "BIP-GMAC-256", "AES-128-CMAC",
@@ -537,7 +530,6 @@ def run_sigma_dut_sae_pw_id_ft(dev, apdev, over_ds=False):
     finally:
         stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_sta_override_rsne(dev, apdev):
     """sigma_dut and RSNE override on STA"""
     ifname = dev[0].ifname
@@ -1222,7 +1214,6 @@ def test_sigma_dut_ap_psk_sae_ft(dev, apdev, params):
         finally:
             stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_owe(dev, apdev):
     """sigma_dut controlled OWE station"""
     if "OWE" not in dev[0].get_capability("key_mgmt"):
@@ -1288,7 +1279,6 @@ def test_sigma_dut_owe(dev, apdev):
     finally:
         stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_owe_ptk_workaround(dev, apdev):
     """sigma_dut controlled OWE station with PTK workaround"""
     if "OWE" not in dev[0].get_capability("key_mgmt"):
@@ -3586,7 +3576,6 @@ def test_sigma_dut_dpp_reconfig_configurator(dev, apdev):
         dev[1].set("dpp_config_processing", "0")
         stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_preconfigured_profile(dev, apdev):
     """sigma_dut controlled connection using preconfigured profile"""
     ifname = dev[0].ifname
@@ -3608,7 +3597,6 @@ def test_sigma_dut_preconfigured_profile(dev, apdev):
     finally:
         stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_wps_pbc(dev, apdev):
     """sigma_dut and WPS PBC Enrollee"""
     ssid = "test-wps-conf"
@@ -3892,7 +3880,6 @@ def test_sigma_dut_ap_ent_ft_eap(dev, apdev, params):
         finally:
             stop_sigma_dut(sigma)
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_venue_url(dev, apdev):
     """sigma_dut controlled Venue URL fetch"""
     ifname = dev[0].ifname
@@ -4696,7 +4683,6 @@ def run_sigma_dut_ap_channel(dev, apdev, params, channel, mode, scan_freq,
             subprocess.call(['iw', 'reg', 'set', '00'])
             dev[0].flush_scan_cache()
 
-@reset_ignore_old_scan_res
 def test_sigma_dut_beacon_prot(dev, apdev):
     """sigma_dut controlled STA and beacon protection"""
     ssid = "test-pmf-required"
index 4e88626615d5224052eeee0977d373dd21c4c760..1b1bc7a160a1b6168a1f5b0944ff34796838677b 100644 (file)
@@ -304,11 +304,3 @@ def disable_ipv6(fn):
             sysctl_write('net.ipv6.conf.all.disable_ipv6=0')
             sysctl_write('net.ipv6.conf.default.disable_ipv6=0')
     return cloned_wrapper(wrapper, fn)
-
-def reset_ignore_old_scan_res(fn):
-    def wrapper(dev, apdev, params):
-        try:
-            var_arg_call(fn, dev, apdev, params)
-        finally:
-            dev[0].set("ignore_old_scan_res", "0")
-    return cloned_wrapper(wrapper, fn)