[PATCH 5/5] tests: Add tests for EHT operation puncturing override

Andrei Otcheretianski andrei.otcheretianski at intel.com
Wed Dec 20 22:49:34 PST 2023


From: Ilan Peer <ilan.peer at intel.com>

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 tests/hwsim/test_eht.py | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py
index 883099298b..c64b2b78cc 100644
--- a/tests/hwsim/test_eht.py
+++ b/tests/hwsim/test_eht.py
@@ -1084,7 +1084,8 @@ def _5ghz_chanwidth_to_bw(op):
         3: "80+80",
     }.get(op, "20")
 
-def _test_eht_5ghz(dev, apdev, channel, chanwidth, ccfs1, ccfs2=0):
+def _test_eht_5ghz(dev, apdev, channel, chanwidth, ccfs1, ccfs2=0,
+                   eht_oper_puncturing_override=None):
     try:
         params = {"ssid": "eht",
                   "country_code": "US",
@@ -1117,6 +1118,9 @@ def _test_eht_5ghz(dev, apdev, channel, chanwidth, ccfs1, ccfs2=0):
                   elif chanwidth == 3:
                       params["vht_capab"] = "[VHT160-80PLUS80]"
 
+        if eht_oper_puncturing_override:
+            params['eht_oper_puncturing_override'] = eht_oper_puncturing_override
+
         freq = 5000 + channel * 5
         if chanwidth != 0 or channel != ccfs1:
             bw = _5ghz_chanwidth_to_bw(chanwidth)
@@ -1128,6 +1132,10 @@ def _test_eht_5ghz(dev, apdev, channel, chanwidth, ccfs1, ccfs2=0):
         eht_verify_wifi_version(dev[0])
         hwsim_utils.test_connectivity(dev[0], hapd)
 
+        if eht_oper_puncturing_override:
+            hapd.set("eht_oper_puncturing_override", "0x0")
+            hapd.request("UPDATE_BEACON")
+            time.sleep(1)
     finally:
         dev[0].request("DISCONNECT")
         set_world_reg(apdev[0], None, dev[0])
@@ -1152,6 +1160,27 @@ def test_eht_5ghz_80mhz_2(dev, apdev):
     """EHT with 80 MHz channel width on 5GHz. Primary=149"""
     _test_eht_5ghz(dev, apdev, 149, 1, 155, 0)
 
+def test_eht_5ghz_80mhz_puncturing_override_1(dev, apdev):
+    """EHT with 80 MHz channel width on 5GHz. Primary=36. Puncturing override."""
+
+    # the 2nd 20MHz is punctured
+    _test_eht_5ghz(dev, apdev, 36, 1, 42, 0,
+                   eht_oper_puncturing_override="0x0002")
+
+def test_eht_5ghz_80mhz_puncturing_override_2(dev, apdev):
+    """EHT with 80 MHz channel width on 5GHz. Primary=149. Puncturing override"""
+
+    # the 3rd 20MHz is punctured
+    _test_eht_5ghz(dev, apdev, 149, 1, 155, 0,
+                   eht_oper_puncturing_override="0x0004")
+
+def test_eht_5ghz_80mhz_puncturing_override_3(dev, apdev):
+    """EHT with 80 MHz channel width on 5GHz. Primary=149. Puncturing override"""
+
+    # the 4th 20MHz is punctured
+    _test_eht_5ghz(dev, apdev, 149, 1, 155, 0,
+                   eht_oper_puncturing_override="0x0008")
+
 def test_eht_5ghz_80p80mhz(dev, apdev):
     """EHT with 80+80 MHz channel width on 5GHz"""
     _test_eht_5ghz(dev, apdev, 36, 3, 42, 155)
-- 
2.43.0




More information about the Hostap mailing list