[RFC] tests: verify RX/TX STBC overrides

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sergey Matyukevich <sergey.matyukevich.os@xxxxxxxxxxxxx>

Commit cdeea70f59d0 added wpa_s configuration options allowing HT STBC
modifications for RX/TX spatial streams. Add tests to verify
overriding of default HT STBC configuration for Tx and Rx
spatial streams for hwsim driver.

The test flow is straightforward: use wpa_s 'tx_stbc' and 'rx_stbc'
configuration options to override default HT Rx/Tx STBC settings
and check HT capabilities IEs in ASSOC frames.
The following tests have been added:

- ap_ht_stbc_disabled
  make sure that HT Rx/Tx STBC is disabled by default for hwsim driver

- ap_ht_stbc_tx
  make sure that Tx STBC can be properly enabled for hwsim driver
  using wpa_s 'tx_stbc' configuration option

- ap_ht_stbc_rx
  make sure that Tx STBC can be properly enabled for hwsim driver
  using wpa_s 'tx_stbc' configuration option

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@xxxxxxxxxxxxx>
---

This patch depends on the following hwsim driver change:
https://patchwork.kernel.org/patch/10752835/

 tests/hwsim/test_ap_ht.py | 68 +++++++++++++++++++++++++++++++++++----
 1 file changed, 62 insertions(+), 6 deletions(-)

diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py
index e6f6502f4..bd452d5ba 100644
--- a/tests/hwsim/test_ap_ht.py
+++ b/tests/hwsim/test_ap_ht.py
@@ -9,11 +9,13 @@ import time
 import logging
 logger = logging.getLogger()
 import struct
+import os
 
 import hostapd
 from utils import HwsimSkip, alloc_fail, parse_ie
 import hwsim_utils
 from test_ap_csa import csa_supported
+from tshark import run_tshark
 
 def clear_scan_cache(apdev):
     ifname = apdev['ifname']
@@ -851,16 +853,70 @@ def test_ap_require_ht(dev, apdev):
                    ampdu_density="1", disable_ht40="1", disable_sgi="1",
                    disable_ldpc="1", rx_stbc="2", tx_stbc="1")
 
-def test_ap_ht_stbc(dev, apdev):
-    """HT STBC overrides"""
+def test_ap_ht_stbc_disabled(dev, apdev, p):
+    """HT STBC overrides: RX/TX STBC is disabled by default"""
     params = { "ssid": "ht" }
     hapd = hostapd.add_ap(apdev[0], params)
 
     dev[0].connect("ht", key_mgmt="NONE", scan_freq="2412")
-    dev[1].connect("ht", key_mgmt="NONE", scan_freq="2412",
-                   rx_stbc="0", tx_stbc="0")
-    dev[2].connect("ht", key_mgmt="NONE", scan_freq="2412",
-                   rx_stbc="1", tx_stbc="1")
+    dev[1].connect("ht", key_mgmt="NONE", scan_freq="2412", tx_stbc="-1", rx_stbc="-1")
+    dev[2].connect("ht", key_mgmt="NONE", scan_freq="2412", tx_stbc="0", rx_stbc="0")
+
+    capfile = os.path.join(p['logdir'], "hwsim0.pcapng")
+    filt = "wlan.sa==%s && wlan.fc.type_subtype == 0x0"
+
+    for sta in [0, 1, 2]:
+        res = run_tshark(capfile, filt % dev[sta].own_addr(), [ "wlan.ht.capabilities.txstbc" ])
+        res = res.splitlines()
+        res = [int(x) for x in res]
+        for tx_stbc in res:
+            if tx_stbc != 0:
+                raise Exception("STA[%d]: TX STBC should be disabled, actual value: %d" % (sta, tx_stbc))
+
+        res = run_tshark(capfile, filt % dev[sta].own_addr(), [ "wlan.ht.capabilities.rxstbc" ])
+        res = res.splitlines()
+        res = [int(x, 16) for x in res]
+        for rx_stbc in res:
+            if rx_stbc != 0:
+                raise Exception("STA[%d]: RX STBC should be disabled, actual value: %d" % (sta, rx_stbc))
+
+def test_ap_ht_stbc_tx(dev, apdev, p):
+    """HT STBC overrides: verify TX STBC configuration"""
+    params = { "ssid": "ht" }
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    dev[0].connect("ht", key_mgmt="NONE", scan_freq="2412", tx_stbc="1")
+
+    capfile = os.path.join(p['logdir'], "hwsim0.pcapng")
+    filt = "wlan.sa==%s && wlan.fc.type_subtype == 0x0"
+
+    res = run_tshark(capfile, filt % dev[0].own_addr(), [ "wlan.ht.capabilities.txstbc" ])
+    res = res.splitlines()
+    res = [int(x) for x in res]
+    for tx_stbc in res:
+        if tx_stbc != 1:
+            raise Exception("TX STBC should be enabled, actual value: %d" % tx_stbc)
+
+def test_ap_ht_stbc_rx(dev, apdev, p):
+    """HT STBC overrides: verify RX STBC configuration"""
+    params = { "ssid": "ht" }
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    dev[0].connect("ht", key_mgmt="NONE", scan_freq="2412", rx_stbc="1")
+    dev[1].connect("ht", key_mgmt="NONE", scan_freq="2412", rx_stbc="2")
+    dev[2].connect("ht", key_mgmt="NONE", scan_freq="2412", rx_stbc="3")
+
+    capfile = os.path.join(p['logdir'], "hwsim0.pcapng")
+    filt = "wlan.sa==%s && wlan.fc.type_subtype == 0x0"
+
+    for sta in [0, 1, 2]:
+        res = run_tshark(capfile, filt % dev[sta].own_addr(), [ "wlan.ht.capabilities.rxstbc" ])
+        res = res.splitlines()
+        res = [int(x, 16) for x in res]
+        expected = sta + 1
+        for actual in res:
+            if actual != expected:
+                raise Exception("STA[%d]: RX STBC expected %d, actual %d" % (sta, expected, actual))
 
 @remote_compatible
 def test_ap_require_ht_limited_rates(dev, apdev):
-- 
2.20.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux