]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify BTM request with link removal imminent flow
authorIlan Peer <ilan.peer@intel.com>
Wed, 13 Dec 2023 14:04:11 +0000 (16:04 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 16 Dec 2023 18:40:23 +0000 (20:40 +0200)
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
tests/hwsim/test_eht.py

index dbffe172f58f7aceabe11471d86eb1cfe7a3682b..785828e99a2171ecff5dcc2f5e659e9ebf5df2a1 100644 (file)
@@ -882,3 +882,52 @@ 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)
+        hapd0.wait_sta()
+        hapd1.wait_sta()
+        traffic_test(wpas, hapd0)
+
+        addr = wpas.own_addr()
+        cmd = "BSS_TM_REQ " + addr + " disassoc_timer=3 disassoc_imminent=1 link_removal_imminent=1 bss_term=0,1"
+        if "OK" not in hapd0.request(cmd):
+            raise Exception("BSS_TM_REQ command failed")
+
+        # Only one link is terminate, so the STA is expected to remain
+        # associated and not start a scan.
+        ev = hapd0.wait_event(['BSS-TM-RESP'], timeout=5)
+        # For now, allow this to pass without the BSS TM response since that
+        # functionality with MLD needs a recent kernel change.
+        #if ev is None:
+        #    raise Exception("No BSS TM response received")
+        if ev and "status_code=0" not in ev:
+            raise Exception("Unexpected BSS TM response contents: " + ev)
+
+        ev = wpas.wait_event(["CTRL-EVENT-SCAN-STARTED",
+                              "CTRL-EVENT-DISCONNECTED"], timeout=10)
+        if ev is not None:
+            raise Exception("Unexpected action on STA: " + ev)