]>
git.ipfire.org Git - thirdparty/lldpd.git/blob - tests/integration/test_dot1.py
4 @pytest.mark
.skipif('Dot1' not in pytest
.config
.lldpd
.features
,
5 reason
="Dot1 not supported")
6 class TestLldpDot1(object):
8 def test_one_vlan(self
, lldpd1
, lldpd
, lldpcli
, namespaces
, links
):
10 links
.vlan('vlan100', 100, 'eth1')
13 out
= lldpcli("-f", "keyvalue", "show", "neighbors", "details")
14 assert out
['lldp.eth0.vlan'] == 'vlan100'
15 assert out
['lldp.eth0.vlan.vlan-id'] == '100'
17 def test_several_vlans(self
, lldpd1
, lldpd
, lldpcli
, namespaces
, links
):
19 for v
in [100, 200, 300, 4000]:
20 links
.vlan('vlan{}'.format(v
), v
, 'eth1')
23 out
= lldpcli("-f", "keyvalue", "show", "neighbors", "details")
24 # We know that lldpd is walking interfaces in index order
25 assert out
['lldp.eth0.vlan'] == \
26 ['vlan100', 'vlan200', 'vlan300', 'vlan4000']
27 assert out
['lldp.eth0.vlan.vlan-id'] == \
28 ['100', '200', '300', '4000']
30 # TODO: PI and PPVID (but lldpd doesn't know how to generate them)