]>
git.ipfire.org Git - thirdparty/lldpd.git/blob - tests/integration/test_dot3.py
7 @pytest.mark
.skipif('Dot3' not in pytest
.config
.lldpd
.features
,
8 reason
="Dot3 not supported")
9 class TestLldpDot3(object):
11 def test_aggregate(self
, lldpd1
, lldpd
, lldpcli
, namespaces
, links
):
12 links(namespaces(3), namespaces(2)) # Another link to setup a bond
14 idx
= links
.bond('bond42', 'eth1', 'eth3')
17 out
= lldpcli("-f", "keyvalue", "show", "neighbors", "details")
18 assert out
['lldp.eth0.port.descr'] == 'eth1'
19 assert out
['lldp.eth0.port.aggregation'] == str(idx
)
21 # TODO: unfortunately, with veth, it's not possible to get an
22 # interface with autoneg.
24 @pytest.mark
.parametrize("command, expected", [
25 ("pse supported enabled paircontrol powerpairs spare class class-3",
32 ("pd supported enabled powerpairs spare class class-3 type 1 source "
33 "pse priority low requested 10000 allocated 15000",
41 'source': 'Primary power source',
44 'allocated': '15000'})])
45 def test_power(self
, lldpd1
, lldpd
, lldpcli
, namespaces
,
50 *shlex
.split("configure dot3 power {}".format(command
)))
51 assert result
.returncode
== 0
54 pfx
= "lldp.eth0.port.power."
55 out
= lldpcli("-f", "keyvalue", "show", "neighbors", "details")
56 out
= {k
[len(pfx
):]: v
57 for k
, v
in out
.items()
59 assert out
== expected