]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify hostapd STA vlan_id value
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 13 Feb 2023 21:17:08 +0000 (23:17 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 13 Feb 2023 21:22:10 +0000 (23:22 +0200)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_ap_ft.py
tests/hwsim/test_ap_vlan.py

index 48c5b522eb6979da530a4f02e4becca5b81bbedb..5bb76165e49c0eb922c438c00f672999b147a9d9 100644 (file)
@@ -378,6 +378,20 @@ def test_ap_ft_vlan(dev, apdev):
     if filename.startswith('/tmp/'):
         os.unlink(filename)
 
+    sta = hapd0.get_sta(dev[0].own_addr())
+    if not (sta and "vlan_id" in sta):
+        raise Exception("VLAN information not in STA output")
+    vlan_id = int(sta["vlan_id"])
+    if vlan_id != 1:
+        raise Exception("Unexpected vlan_id %d" % vlan_id)
+
+    sta = hapd1.get_sta(dev[0].own_addr())
+    if not (sta and "vlan_id" in sta):
+        raise Exception("VLAN information not in STA output")
+    vlan_id = int(sta["vlan_id"])
+    if vlan_id != 1:
+        raise Exception("Unexpected vlan_id %d" % vlan_id)
+
 def test_ap_ft_vlan_disconnected(dev, apdev):
     """WPA2-PSK-FT AP with VLAN and local key generation"""
     ssid = "test-ft"
index e50f76252aed27d68043591469248abe0234760f..d2271fad8085f37563aa9b21b9e47211859d937b 100644 (file)
@@ -782,6 +782,14 @@ def test_ap_vlan_psk(dev, apdev, params):
     hwsim_utils.test_connectivity_iface(dev[1], hapd, "brvlan2")
     hwsim_utils.test_connectivity_iface(dev[2], hapd, "brvlan3")
 
+    for i in range(3):
+        sta = hapd.get_sta(dev[i].own_addr())
+        if not (sta and "vlan_id" in sta):
+            raise Exception("VLAN information not in STA output")
+        vlan_id = int(sta["vlan_id"])
+        if vlan_id != i + 1:
+            raise Exception("Unexpected vlan_id %d for dev[%d]" % (vlan_id, i))
+
 def test_ap_vlan_sae(dev, apdev, params):
     """AP VLAN based on SAE Password Identifier"""
     for i in range(3):
@@ -804,3 +812,11 @@ def test_ap_vlan_sae(dev, apdev, params):
     hwsim_utils.test_connectivity_iface(dev[0], hapd, "brvlan1")
     hwsim_utils.test_connectivity_iface(dev[1], hapd, "brvlan2")
     hwsim_utils.test_connectivity_iface(dev[2], hapd, "brvlan3")
+
+    for i in range(3):
+        sta = hapd.get_sta(dev[i].own_addr())
+        if not (sta and "vlan_id" in sta):
+            raise Exception("VLAN information not in STA output")
+        vlan_id = int(sta["vlan_id"])
+        if vlan_id != i + 1:
+            raise Exception("Unexpected vlan_id %d for dev[%d]" % (vlan_id, i))