if when == 'before':
lldpd()
else:
- # IPv6 DAD may kick in
time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
if when == 'before':
lldpd()
else:
- # IPv6 DAD may kick in
time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth0.port.mac'] == '00:00:00:00:00:02'
+@pytest.mark.skipif('Dot3' not in pytest.config.lldpd.features,
+ reason="Dot3 not supported")
+@pytest.mark.parametrize('when', ['before', 'after'])
+def test_team(lldpd1, lldpd, lldpcli, namespaces, links, when):
+ links(namespaces(3), namespaces(2)) # Another link to setup a bond
+ with namespaces(2):
+ if when == 'after':
+ lldpd()
+ idx = links.team('team42', 'eth3', 'eth1')
+ if when == 'before':
+ lldpd()
+ else:
+ time.sleep(6)
+ with namespaces(1):
+ out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
+ assert out['lldp.eth0.port.descr'] == 'eth1'
+ assert out['lldp.eth0.port.aggregation'] == str(idx)
+ # Unfortunately, we cannot get the right MAC currently... So,
+ # this bit will succeed by chance.
+ assert out['lldp.eth0.port.mac'] == '00:00:00:00:00:02'
+
+
@pytest.mark.skipif('Dot3' not in pytest.config.lldpd.features,
reason="Dot3 not supported")
@pytest.mark.skipif('Dot1' not in pytest.config.lldpd.features,
if when == 'before':
lldpd()
else:
- # IPv6 DAD may kick in
time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
links.vlan('vlan500', 500, iface)
lldpd()
links.remove('vlan300')
- time.sleep(4)
+ time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth0.port.descr'] == 'eth1'
lldpd()
links.remove('bond42')
links.up('eth1')
- time.sleep(4)
+ time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth0.port.descr'] == 'eth1'
lldpd()
links.remove('bond42')
links.up('eth1')
- time.sleep(4)
+ time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth0.port.descr'] == 'eth1'
assert out == {}
with namespaces(2):
links.up('eth1')
- time.sleep(2)
+ time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth0.port.descr'] == 'eth1'
+@pytest.mark.skipif('Dot1' not in pytest.config.lldpd.features,
+ reason="Dot1 not supported")
def test_down_then_up_with_vlan(lldpd1, lldpd, lldpcli, namespaces, links):
with namespaces(2):
links.vlan('vlan300', 300, 'eth1')
links.down('eth1')
lldpd()
links.up('eth1')
- time.sleep(2)
+ time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth0.port.descr'] == 'eth1'
def test_new_interface(lldpd1, lldpd, lldpcli, namespaces, links):
with namespaces(2):
lldpd()
- links(namespaces(1), namespaces(2))
- time.sleep(2)
+ links(namespaces(1), namespaces(2), 4)
+ time.sleep(6)
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth0.port.descr'] == 'eth1'