diff mbox series

tests: HE: add a test for wifi generation on 2.4 GHz

Message ID 1602583027-Ia42a8a12f390519f38655d8205428ee03764d844@changeid
State Superseded
Headers show
Series tests: HE: add a test for wifi generation on 2.4 GHz | expand

Commit Message

Johannes Berg Oct. 13, 2020, 9:57 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

This was broken in the kernel in mac80211 for a while, until commit
780a8c9efc65 ("mac80211: do not disable HE if HT is missing on 2.4 GHz")
fixed it.

Add a test for wifi generation on 2.4 GHz in addition to the 5 GHz one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 tests/hwsim/test_he.py | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)

Comments

Johannes Berg Oct. 13, 2020, 11:36 a.m. UTC | #1
On Tue, 2020-10-13 at 11:57 +0200, Johannes Berg wrote:
 
> -def test_he_wifi_generation(dev, apdev):
> +def _test_he_wifi_generation(dev, apdev, conf, scan_freq):
>      """HE and wifi_generation"""
>      try:
>          hapd = None
>          params = {"ssid": "he",
>                    "country_code": "FI",
> -                  "hw_mode": "a",
> -                  "channel": "36",
> -                  "ht_capab": "[HT40+]",
>                    "ieee80211n": "1",
>                    "ieee80211ac": "1",

Wait, this is broken ... shouldn't have VHT here.

And then it shows another mac80211 bug :(

johannes
diff mbox series

Patch

diff --git a/tests/hwsim/test_he.py b/tests/hwsim/test_he.py
index 28123e853ca1..5c3773222d7d 100644
--- a/tests/hwsim/test_he.py
+++ b/tests/hwsim/test_he.py
@@ -154,27 +154,20 @@  def test_he80(dev, apdev):
         dev[0].request("DISCONNECT")
         clear_regdom(hapd, dev)
 
-def test_he_wifi_generation(dev, apdev):
+def _test_he_wifi_generation(dev, apdev, conf, scan_freq):
     """HE and wifi_generation"""
     try:
         hapd = None
         params = {"ssid": "he",
                   "country_code": "FI",
-                  "hw_mode": "a",
-                  "channel": "36",
-                  "ht_capab": "[HT40+]",
                   "ieee80211n": "1",
                   "ieee80211ac": "1",
-                  "ieee80211ax": "1",
-                  "vht_oper_chwidth": "1",
-                  "vht_capab": "[MAX-MPDU-11454]",
-                  "vht_oper_centr_freq_seg0_idx": "42",
-                  "he_oper_chwidth": "1",
-                  "he_oper_centr_freq_seg0_idx": "42"}
+                  "ieee80211ax": "1"}
+        params.update(conf)
         hapd = hostapd.add_ap(apdev[0], params)
         bssid = apdev[0]['bssid']
 
-        dev[0].connect("he", key_mgmt="NONE", scan_freq="5180")
+        dev[0].connect("he", key_mgmt="NONE", scan_freq=scan_freq)
         status = dev[0].get_status()
         if 'wifi_generation' not in status:
             # For now, assume this is because of missing kernel support
@@ -185,7 +178,7 @@  def test_he_wifi_generation(dev, apdev):
 
         wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
         wpas.interface_add("wlan5", drv_params="force_connect_cmd=1")
-        wpas.connect("he", key_mgmt="NONE", scan_freq="5180")
+        wpas.connect("he", key_mgmt="NONE", scan_freq=scan_freq)
         status = wpas.get_status()
         if 'wifi_generation' not in status:
             # For now, assume this is because of missing kernel support
@@ -202,6 +195,26 @@  def test_he_wifi_generation(dev, apdev):
         dev[0].request("DISCONNECT")
         clear_regdom(hapd, dev)
 
+def test_he_wifi_generation(dev, apdev):
+    conf = {
+        "vht_oper_chwidth": "1",
+        "hw_mode": "a",
+        "channel": "36",
+        "ht_capab": "[HT40+]",
+        "vht_oper_centr_freq_seg0_idx": "42",
+        "he_oper_chwidth": "1",
+        "he_oper_centr_freq_seg0_idx": "42",
+        "vht_capab": "[MAX-MPDU-11454]",
+    }
+    _test_he_wifi_generation(dev, apdev, conf, "5180")
+
+def test_he_wifi_generation_24(dev, apdev):
+    conf = {
+        "hw_mode": "g",
+        "channel": "1",
+    }
+    _test_he_wifi_generation(dev, apdev, conf, "2412")
+
 def he80_test(apdev, dev, channel, ht_capab):
     clear_scan_cache(apdev)
     try: