From 24e8fda8fa36815cb0a83c86eb1bf6c705ad47a2 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 1 Feb 2020 16:44:41 +0100 Subject: [PATCH] tests: check we don't mix VLAN among interfaces --- tests/integration/test_interfaces.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/integration/test_interfaces.py b/tests/integration/test_interfaces.py index 29d7ad4f..1e34d08f 100644 --- a/tests/integration/test_interfaces.py +++ b/tests/integration/test_interfaces.py @@ -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", -- 2.39.5