diff mbox series

[v2,4/4] tests: AP VLAN and the statistics of a STA bound to a VLAN interface

Message ID 20261016235956.3497471-5-me@andrei-z.com
State New
Headers show
Series nl80211: Station reads on kernels that do not filter the station dump | expand

Commit Message

Andrei-Alexandru Bleortu Oct. 16, 2026, 11:59 p.m. UTC
Assisted-by: LLM
Signed-off-by: Andrei-Alexandru Bleortu <me@andrei-z.com>
---
 tests/hwsim/test_ap_vlan.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/tests/hwsim/test_ap_vlan.py b/tests/hwsim/test_ap_vlan.py
index 029b97859..143c80936 100644
--- a/tests/hwsim/test_ap_vlan.py
+++ b/tests/hwsim/test_ap_vlan.py
@@ -42,6 +42,25 @@  def test_ap_vlan_open(dev, apdev):
     if filename.startswith('/tmp/'):
         os.unlink(filename)
 
+def test_ap_vlan_sta_statistics(dev, apdev):
+    """AP VLAN and the statistics of a STA bound to a VLAN interface"""
+    filename = hostapd.acl_file(dev, apdev, 'hostapd.accept')
+    hostapd.send_file(apdev[0], filename, filename)
+    params = {"ssid": "test-vlan-open",
+              "dynamic_vlan": "1",
+              "accept_mac_file": filename}
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    dev[0].connect("test-vlan-open", key_mgmt="NONE", scan_freq="2412")
+    for i in range(10):
+        hwsim_utils.test_connectivity_iface(dev[0], hapd, "brvlan1")
+    sta = hapd.get_sta(dev[0].own_addr())
+    logger.info("STA: " + str(sta))
+    if int(sta['rx_packets']) < 10 or int(sta['tx_packets']) < 10:
+        raise Exception("No statistics for the STA on its VLAN interface")
+    if filename.startswith('/tmp/'):
+        os.unlink(filename)
+
 def test_ap_vlan_file_open(dev, apdev):
     """AP VLAN with open network and vlan_file mapping"""
     filename = hostapd.acl_file(dev, apdev, 'hostapd.accept')