[PATCH 5/5] tests: pass extra_selectors to nl80211 driver
Benjamin Berg
benjamin at sipsolutions.net
Wed Jan 8 01:10:33 PST 2025
From: Benjamin Berg <benjamin.berg at intel.com>
mac80211 will start checking whether the selectors present in the
supported rates set are supported by the location station. Add the
appropriate options so that the check is bypassed when implemented on
newer kernels.
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
tests/hwsim/test_ap_ht.py | 22 ++++++++++++++--------
tests/hwsim/test_ap_vht.py | 11 +++++++----
tests/hwsim/test_he.py | 21 ++++++++++++---------
tests/hwsim/test_owe.py | 14 ++++++++------
4 files changed, 41 insertions(+), 27 deletions(-)
diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py
index 4ae02234e0..2e69b1b155 100644
--- a/tests/hwsim/test_ap_ht.py
+++ b/tests/hwsim/test_ap_ht.py
@@ -871,11 +871,14 @@ def test_ap_require_ht(dev, apdev):
"require_ht": "1"}
hapd = hostapd.add_ap(apdev[0], params)
- dev[1].connect("require-ht", key_mgmt="NONE", scan_freq="2412",
- disable_ht="1", wait_connect=False)
+ wpas_force = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas_force.interface_add("wlan5", drv_params="extra_selectors=127")
+
+ wpas_force.connect("require-ht", key_mgmt="NONE", scan_freq="2412",
+ disable_ht="1", wait_connect=False)
dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
- ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
- dev[1].request("DISCONNECT")
+ ev = wpas_force.wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+ wpas_force.request("DISCONNECT")
if ev is None:
raise Exception("Association rejection timed out")
if "status_code=27" not in ev:
@@ -912,11 +915,14 @@ def test_ap_require_ht_limited_rates(dev, apdev):
"require_ht": "1"}
hapd = hostapd.add_ap(apdev[0], params)
- dev[1].connect("require-ht", key_mgmt="NONE", scan_freq="2412",
- disable_ht="1", wait_connect=False)
+ wpas_force = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas_force.interface_add("wlan5", drv_params="extra_selectors=127")
+
+ wpas_force.connect("require-ht", key_mgmt="NONE", scan_freq="2412",
+ disable_ht="1", wait_connect=False)
dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
- ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
- dev[1].request("DISCONNECT")
+ ev = wpas_force.wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+ wpas_force.request("DISCONNECT")
if ev is None:
raise Exception("Association rejection timed out")
if "status_code=27" not in ev:
diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py
index 5ba0227e76..010db1b83b 100644
--- a/tests/hwsim/test_ap_vht.py
+++ b/tests/hwsim/test_ap_vht.py
@@ -211,17 +211,20 @@ def test_ap_vht80_params(dev, apdev):
"require_vht": "1"}
hapd = hostapd.add_ap(apdev[0], params)
- dev[1].connect("vht", key_mgmt="NONE", scan_freq="5180",
- disable_vht="1", wait_connect=False)
+ wpas_force = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas_force.interface_add("wlan5", drv_params="extra_selectors=126")
+
+ wpas_force.connect("vht", key_mgmt="NONE", scan_freq="5180",
+ disable_vht="1", wait_connect=False)
dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
dev[2].connect("vht", key_mgmt="NONE", scan_freq="5180",
disable_sgi="1")
- ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+ ev = wpas_force.wait_event(["CTRL-EVENT-ASSOC-REJECT"])
if ev is None:
raise Exception("Association rejection timed out")
if "status_code=104" not in ev:
raise Exception("Unexpected rejection status code")
- dev[1].request("DISCONNECT")
+ wpas_force.request("DISCONNECT")
hwsim_utils.test_connectivity(dev[0], hapd)
sta0 = hapd.get_sta(dev[0].own_addr())
sta2 = hapd.get_sta(dev[2].own_addr())
diff --git a/tests/hwsim/test_he.py b/tests/hwsim/test_he.py
index 917313feeb..f58ec8f96d 100644
--- a/tests/hwsim/test_he.py
+++ b/tests/hwsim/test_he.py
@@ -327,21 +327,24 @@ def test_he80_params(dev, apdev):
"he_rts_threshold":"1"}
hapd = hostapd.add_ap(apdev[0], params)
- dev[1].connect("he", key_mgmt="NONE", scan_freq="5180",
- disable_vht="1", wait_connect=False)
+ wpas_force = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas_force.interface_add("wlan5", drv_params="extra_selectors=126,122")
+
+ wpas_force.connect("he", key_mgmt="NONE", scan_freq="5180",
+ disable_vht="1", wait_connect=False)
dev[0].connect("he", key_mgmt="NONE", scan_freq="5180")
dev[2].connect("he", key_mgmt="NONE", scan_freq="5180",
disable_sgi="1")
- ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+ ev = wpas_force.wait_event(["CTRL-EVENT-ASSOC-REJECT"])
if ev is None:
raise Exception("Association rejection timed out")
if "status_code=104" not in ev:
raise Exception("Unexpected rejection status code")
- dev[1].request("DISCONNECT")
- dev[1].request("REMOVE_NETWORK all")
- dev[1].dump_monitor()
- dev[1].connect("he", key_mgmt="NONE", scan_freq="5180",
- disable_he="1", wait_connect=False)
+ wpas_force.request("DISCONNECT")
+ wpas_force.request("REMOVE_NETWORK all")
+ wpas_force.dump_monitor()
+ wpas_force.connect("he", key_mgmt="NONE", scan_freq="5180",
+ disable_he="1", wait_connect=False)
hwsim_utils.test_connectivity(dev[0], hapd)
sta0 = hapd.get_sta(dev[0].own_addr())
sta2 = hapd.get_sta(dev[2].own_addr())
@@ -351,7 +354,7 @@ def test_he80_params(dev, apdev):
raise Exception("dev[0] did not support SGI")
if capab2 & 0x60 != 0:
raise Exception("dev[2] claimed support for SGI")
- ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+ ev = wpas_force.wait_event(["CTRL-EVENT-ASSOC-REJECT"])
if ev is None:
raise Exception("Association rejection timed out (2)")
if "status_code=124" not in ev:
diff --git a/tests/hwsim/test_owe.py b/tests/hwsim/test_owe.py
index 98254e54b5..c4ab7fbdec 100644
--- a/tests/hwsim/test_owe.py
+++ b/tests/hwsim/test_owe.py
@@ -749,11 +749,13 @@ def test_owe_assoc_reject(dev, apdev):
bssid = hapd.own_addr()
# First, reject two associations with HT-required (i.e., not OWE related)
- dev[0].scan_for_bss(bssid, freq="2412")
- dev[0].connect("owe", key_mgmt="OWE", ieee80211w="2",
- disable_ht="1", scan_freq="2412", wait_connect=False)
+ wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas.interface_add("wlan5", drv_params="extra_selectors=127")
+ wpas.scan_for_bss(bssid, freq="2412")
+ wpas.connect("owe", key_mgmt="OWE", ieee80211w="2",
+ disable_ht="1", scan_freq="2412", wait_connect=False)
for i in range(0, 2):
- ev = dev[0].wait_event(["CTRL-EVENT-ASSOC-REJECT"], timeout=10)
+ ev = wpas.wait_event(["CTRL-EVENT-ASSOC-REJECT"], timeout=10)
if ev is None:
raise Exception("Association rejection not reported")
@@ -761,8 +763,8 @@ def test_owe_assoc_reject(dev, apdev):
# attempt instead of having moved to testing another group.
hapd.set("require_ht", "0")
for i in range(0, 2):
- ev = dev[0].wait_event(["CTRL-EVENT-ASSOC-REJECT",
- "CTRL-EVENT-CONNECTED"], timeout=10)
+ ev = wpas.wait_event(["CTRL-EVENT-ASSOC-REJECT",
+ "CTRL-EVENT-CONNECTED"], timeout=10)
if ev is None:
raise Exception("Association result not reported")
if "CTRL-EVENT-CONNECTED" in ev:
--
2.47.1
More information about the Hostap
mailing list