[PATCH 11/15] tests: UHR with and without security profiles
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Tue Nov 24 00:53:07 PST 2026
From: Ilan Peer <ilan.peer at intel.com>
Verify that UHR is used with security profile 9 and that the station
falls back to EHT when it does not use a security profile or the AP does
not advertise one.
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
tests/hwsim/test_uhr.py | 47 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/tests/hwsim/test_uhr.py b/tests/hwsim/test_uhr.py
index af654e8824..2b90759c57 100644
--- a/tests/hwsim/test_uhr.py
+++ b/tests/hwsim/test_uhr.py
@@ -95,6 +95,53 @@ def test_uhr_simple(dev, apdev):
if "wifi_generation=8" not in status:
raise Exception("STA STATUS did not indicate wifi_generation=8")
+def run_uhr_sec_prof(security_profiles, sta_sec_prof, expect_uhr):
+ with HWSimRadio(use_mlo=True) as (hapd_radio, hapd_iface), \
+ HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface):
+ wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas.interface_add(wpas_iface)
+ check_sae_capab(wpas)
+
+ passphrase = 'qwertyuiop'
+ params = eht_mld_ap_wpa2_params("uhr", key_mgmt="SAE-EXT-KEY",
+ passphrase=passphrase,
+ pwe='1', mfp='2', beacon_prot=1)
+ params['rsn_pairwise'] = "CCMP GCMP-256"
+ params['ieee80211bn'] = '1'
+ if security_profiles:
+ params['security_profiles'] = security_profiles
+ try:
+ hapd = eht_mld_enable_ap(hapd_iface, 0, params)
+ except Exception as e:
+ if isinstance(e, Exception) and \
+ str(e) == "Failed to set hostapd parameter ieee80211bn":
+ raise HwsimSkip("UHR not supported")
+ raise
+ if sta_sec_prof:
+ wpas.set("security_profiles", "1")
+ wpas.set("sae_pwe", "1")
+ wpas.connect("uhr", key_mgmt="SAE-EXT-KEY", sae_password=passphrase,
+ ieee80211w="2", beacon_prot="1",
+ pairwise="CCMP GCMP-256", scan_freq="2412")
+ hapd.wait_sta()
+ uhr_verify_status(wpas, hapd, is_ht=True, sta_expect_uhr=expect_uhr)
+ if expect_uhr:
+ uhr_verify_wifi_version(wpas)
+ else:
+ eht_verify_wifi_version(wpas)
+
+def test_uhr_sec_prof(dev, apdev):
+ """UHR used with security profile 9"""
+ run_uhr_sec_prof('9', True, True)
+
+def test_uhr_sec_prof_not_used(dev, apdev):
+ """UHR not used when the station does not use a security profile"""
+ run_uhr_sec_prof('9', False, False)
+
+def test_uhr_sec_prof_ap_no_sec_prof(dev, apdev):
+ """UHR not used when the AP does not advertise security profiles"""
+ run_uhr_sec_prof(None, True, False)
+
def test_uhr_required_not_supported(dev, apdev):
"""no connection if UHR is required but not supported by client"""
with HWSimRadio(use_mlo=True) as (hapd_radio, hapd_iface):
--
2.56.1
More information about the Hostap
mailing list