diff mbox series

[7/8] tests: Verify BTM request with link removal imminent flow

Message ID 20231213140412.326465-7-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series [1/8] AP: WNM: Use correct address when configured as AP MLD | expand

Commit Message

Andrei Otcheretianski Dec. 13, 2023, 2:04 p.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 tests/hwsim/test_eht.py | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
diff mbox series

Patch

diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py
index dbffe172f5..c1a6b17121 100644
--- a/tests/hwsim/test_eht.py
+++ b/tests/hwsim/test_eht.py
@@ -882,3 +882,40 @@  def test_eht_mld_link_removal(dev, apdev):
 
         logger.info("Test traffic after 1st link disabled")
         traffic_test(wpas, hapd0, success=False)
+
+def test_eht_mld_bss_trans_mgmt_link_removal_imminent(dev, apdev):
+    """EHT MLD with two links. BSS transition management with link removal imminent"""
+
+    with HWSimRadio(use_mlo=True) as (hapd0_radio, hapd0_iface), \
+        HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface):
+
+        wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+        wpas.interface_add(wpas_iface)
+
+        ssid = "mld_ap_owe_two_link"
+        params = eht_mld_ap_wpa2_params(ssid, key_mgmt="OWE", mfp="2")
+        params["bss_transition"] = "1"
+        params["mbo"] = "1"
+
+        hapd0 = eht_mld_enable_ap(hapd0_iface, params)
+
+        params['channel'] = '6'
+
+        hapd1 = eht_mld_enable_ap(hapd0_iface, params)
+
+        wpas.connect(ssid, scan_freq="2412 2437", key_mgmt="OWE", ieee80211w="2")
+        eht_verify_status(wpas, hapd0, 2412, 20, is_ht=True, mld=True, valid_links=3,
+                           active_links=3)
+        eht_verify_wifi_version(wpas)
+        traffic_test(wpas, hapd0)
+
+        addr = wpas.own_addr()
+        cmd = "BSS_TM_REQ " + addr + " disassoc_timer=3 disassoc_imminent=1 link_removal_imminent=1"
+
+        if "OK" not in hapd0.request(cmd):
+            raise Exception("BSS_TM_REQ command failed")
+
+        # The station is expected to ignore the BSS TM request as it is associated with multiple links
+        ev = hapd0.wait_event(['BSS-TM-RESP'], timeout=2)
+        if ev:
+            raise Exception("Unexpected BSS TM response: " + ev )