]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix eht_mld_sae_legacy_client to restore sae_pwe
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 21 Jul 2023 17:17:53 +0000 (20:17 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 21 Jul 2023 17:17:53 +0000 (20:17 +0300)
Changing sae_pwe and leaving the modified value for the following test
cases can result in failures.

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

index 9b8a1831f476e15a80fa53f472f57ef82843b762..0b85fb90214bf6e0737f1dce0ca3610eae89e51c 100644 (file)
@@ -403,13 +403,17 @@ def test_eht_mld_sae_legacy_client(dev, apdev):
 
         hapd1 = eht_mld_enable_ap(hapd_iface, params)
 
-        dev[0].set("sae_groups", "")
-        dev[0].set("sae_pwe", "1")
-        dev[0].connect(ssid, sae_password=passphrase, scan_freq="2412",
-                       key_mgmt="SAE", ieee80211w="2", beacon_prot="1")
-
-        eht_verify_status(dev[0], hapd0, 2412, 20, is_ht=True)
-        traffic_test(dev[0], hapd0)
+        try:
+            dev[0].set("sae_groups", "")
+            dev[0].set("sae_pwe", "1")
+            dev[0].connect(ssid, sae_password=passphrase, scan_freq="2412",
+                           key_mgmt="SAE", ieee80211w="2", beacon_prot="1")
+
+            eht_verify_status(dev[0], hapd0, 2412, 20, is_ht=True)
+            traffic_test(dev[0], hapd0)
+        finally:
+            dev[0].set("sae_groups", "")
+            dev[0].set("sae_pwe", "0")
 
 def test_eht_mld_sae_transition(dev, apdev):
     """EHT MLD AP in SAE/PSK transition mode with MLD client connection using two links"""