]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Add color change test for an AP MLD
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Mon, 22 Apr 2024 12:40:05 +0000 (18:10 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 12 Jun 2024 09:42:33 +0000 (12:42 +0300)
Add the eht_mlo_color_change test case to perform color change on the
first link of an AP MLD. Performing on non-first link will be done
later.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
tests/hwsim/test_eht.py

index 45f210d97d9ed476fab99d49f4eab8613b616b77..d8fbf581547690a0e8ef78ac33f233ef3425b563 100644 (file)
@@ -2127,3 +2127,46 @@ def test_eht_mld_cohosted_connectivity(dev, apdev, params):
         traffic_test(wpas1, hapds[2])
 
         stop_mld_devs(hapds, params['prefix'])
+
+def test_eht_mlo_color_change(dev, apdev):
+    """AP MLD and Color Change Announcement"""
+    with HWSimRadio(use_mlo=True) as (hapd_radio, hapd_iface), \
+        HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface):
+
+        ssid = "mld_ap"
+        passphrase = 'qwertyuiop'
+
+        params = eht_mld_ap_wpa2_params(ssid, passphrase,
+                                        key_mgmt="SAE", mfp="2", pwe='1')
+        params['he_bss_color'] = '42'
+
+        hapd0 = eht_mld_enable_ap(hapd_iface, params)
+
+        params['channel'] = '6'
+        params['he_bss_color'] = '24'
+
+        hapd1 = eht_mld_enable_ap(hapd_iface, params)
+
+        logger.info("Perform CCA on 1st link")
+        if "OK" not in hapd0.request("COLOR_CHANGE 10"):
+            raise Exception("COLOR_CHANGE failed")
+
+        time.sleep(1.5)
+
+        color = hapd0.get_status_field("he_bss_color")
+        if color != "10":
+            raise Exception("Expected current he_bss_color to be 10; was " + color)
+
+        logger.info("Perform CCA on 1st link again")
+        if "OK" not in hapd0.request("COLOR_CHANGE 60"):
+            raise Exception("COLOR_CHANGE failed")
+        time.sleep(1.5)
+
+        color = hapd0.get_status_field("he_bss_color")
+        if color != "60":
+            raise Exception("Expected current he_bss_color to be 60; was " + color)
+
+        #TODO: CCA on non-first link
+
+        hapd0.dump_monitor()
+        hapd1.dump_monitor()