]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: AP MLD with two links and non-AP MLD sending ML Probe Request
authorJouni Malinen <j@w1.fi>
Sun, 29 Oct 2023 14:02:11 +0000 (16:02 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Oct 2023 14:07:14 +0000 (16:07 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_eht.py

index 657feb06e89792e67650c0ec76147be764791035..27b96290e7db42d51c6f55049bf6a57f760b2df1 100644 (file)
@@ -502,3 +502,43 @@ def test_eht_mld_ptk_rekey(dev, apdev):
         time.sleep(0.1)
         traffic_test(wpas, hapd0)
         traffic_test(wpas, hapd1)
+
+def test_eht_ml_probe_req(dev, apdev):
+    """AP MLD with two links and non-AP MLD sending ML Probe Request"""
+    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)
+
+        passphrase = 'qwertyuiop'
+        ssid = "mld_ap_sae_two_link"
+        params = eht_mld_ap_wpa2_params(ssid, passphrase,
+                                        key_mgmt="SAE-EXT-KEY")
+
+        hapd0 = eht_mld_enable_ap(hapd_iface, params)
+
+        params['channel'] = '6'
+
+        hapd1 = eht_mld_enable_ap(hapd_iface, params)
+
+        bssid = hapd0.own_addr()
+        wpas.scan_for_bss(bssid, freq=2412)
+
+        time.sleep(1)
+        cmd = "ML_PROBE_REQ bssid=" + bssid + " mld_id=0"
+        if "OK" not in wpas.request(cmd):
+            raise Exception("Failed to run: " + cmd)
+        ev = wpas.wait_event(["CTRL-EVENT-SCAN-RESULTS",
+                              "CTRL-EVENT-SCAN-FAILED"], timeout=10)
+        if ev is None:
+            raise Exception("ML_PROBE_REQ did not result in scan results")
+
+        time.sleep(1)
+        cmd = "ML_PROBE_REQ bssid=" + bssid + " mld_id=0 link_id=2"
+        if "OK" not in wpas.request(cmd):
+            raise Exception("Failed to run: " + cmd)
+        ev = wpas.wait_event(["CTRL-EVENT-SCAN-RESULTS",
+                              "CTRL-EVENT-SCAN-FAILED"], timeout=10)
+        if ev is None:
+            raise Exception("ML_PROBE_REQ did not result in scan results")