]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tests: check we don't mix VLAN among interfaces
authorVincent Bernat <vincent@bernat.ch>
Sat, 1 Feb 2020 15:44:41 +0000 (16:44 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sat, 1 Feb 2020 15:44:41 +0000 (16:44 +0100)
tests/integration/test_interfaces.py

index 29d7ad4f4294b6f8d01d9d864e393f76a1dd0a62..1e34d08f3f8f37eb97ff5949308170b15e47f8ec 100644 (file)
@@ -68,6 +68,8 @@ def test_bridge_with_vlan(lldpd1, lldpd, lldpcli, namespaces, links, when):
 def test_vlan_aware_bridge_with_vlan(lldpd1, lldpd, lldpcli, namespaces, links,
                                      when):
     links(namespaces(3), namespaces(2))  # Another link to setup a bridge
+    with namespaces(3):
+        lldpd()
     with namespaces(2):
         if when == 'after':
             lldpd()
@@ -75,6 +77,7 @@ def test_vlan_aware_bridge_with_vlan(lldpd1, lldpd, lldpcli, namespaces, links,
         links.bridge_vlan('eth1', 100, pvid=True)
         links.bridge_vlan('eth1', 200)
         links.bridge_vlan('eth1', 300)
+        links.bridge_vlan('eth3', 400)
         if when == 'before':
             lldpd()
         else:
@@ -88,6 +91,15 @@ def test_vlan_aware_bridge_with_vlan(lldpd1, lldpd, lldpcli, namespaces, links,
             ['100', '200', '300']
         assert out['lldp.eth0.vlan.pvid'] == \
             ['yes', 'no', 'no']
+    with namespaces(3):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
+        assert out['lldp.eth2.port.descr'] == 'eth3'
+        assert out['lldp.eth2.vlan'] == \
+            'vlan400'
+        assert out['lldp.eth2.vlan.vlan-id'] == \
+            '400'
+        assert out['lldp.eth2.vlan.pvid'] == \
+            'no'
 
 
 @pytest.mark.skipif("'Dot3' not in config.lldpd.features",