[PATCH 1/2] tests: make run_ap_pmf_beacon_protection_mismatch more robust

Johannes Berg johannes at sipsolutions.net
Mon Feb 9 09:40:13 PST 2026


From: Johannes Berg <johannes.berg at intel.com>

This test relies on the fact that key ID 6 is being used at
this point. Also overwrite key ID 7 in case it's used instead.

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 tests/hwsim/test_ap_pmf.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/hwsim/test_ap_pmf.py b/tests/hwsim/test_ap_pmf.py
index caf2fb4c4cd9..22ace9f9fa41 100644
--- a/tests/hwsim/test_ap_pmf.py
+++ b/tests/hwsim/test_ap_pmf.py
@@ -1534,6 +1534,13 @@ def run_ap_pmf_beacon_protection_mismatch(dev, apdev, clear):
     if "OK" not in res:
         raise Exception("SET_KEY failed")
 
+    if clear:
+        res = hapd.request("SET_KEY %d %s %d %d %s %s %d" % (WPA_ALG_NONE, addr, 7, 1, 6*"00", "", KEY_FLAG_GROUP))
+    else:
+        res = hapd.request("SET_KEY %d %s %d %d %s %s %d" % (WPA_ALG_IGTK, addr, 7, 1, 6*"00", 16*"00", KEY_FLAG_GROUP_TX_DEFAULT))
+    if "OK" not in res:
+        raise Exception("SET_KEY failed")
+
     ev = dev[0].wait_event(["CTRL-EVENT-UNPROT-BEACON"], timeout=5)
     if ev is None:
         raise Exception("Unprotected Beacon frame not reported")
-- 
2.53.0




More information about the Hostap mailing list