with namespaces(1):
result = lldpcli("show", "neighbors", "details")
assert result.returncode == 0
with namespaces(1):
result = lldpcli("show", "neighbors", "details")
assert result.returncode == 0
expected = """-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
expected = """-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Capability: Station, {station}
Port:
PortID: mac 00:00:00:00:00:02
Capability: Station, {station}
Port:
PortID: mac 00:00:00:00:00:02
-------------------------------------------------------------------------------
"""
out = result.stdout.decode('ascii')
-------------------------------------------------------------------------------
"""
out = result.stdout.decode('ascii')
"capability[@type='Router']")[0].attrib['enabled']
station = xml.findall("./interface[1]/chassis/"
"capability[@type='Station']")[0].attrib['enabled']
"capability[@type='Router']")[0].attrib['enabled']
station = xml.findall("./interface[1]/chassis/"
"capability[@type='Station']")[0].attrib['enabled']
expected = ET.fromstring("""<?xml version="1.0" encoding="UTF-8"?>
<lldp label="LLDP neighbors">
<interface label="Interface" name="eth0" via="LLDP" rid="1" age="{age}">
expected = ET.fromstring("""<?xml version="1.0" encoding="UTF-8"?>
<lldp label="LLDP neighbors">
<interface label="Interface" name="eth0" via="LLDP" rid="1" age="{age}">
- <descr label="PortDescr">eth1</descr>
- <auto-negotiation enabled="no" label="PMD autoneg" supported="no">
- <current label="MAU oper type">10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable</current>
- </auto-negotiation>
+ <descr label="PortDescr">eth1</descr>{dot3}
assert out['lldp.eth0.port.descr'] == 'eth1'
assert out['lldp.eth0.port.power.device-type'] == 'PSE'
links(namespaces(1), namespaces(2))
assert out['lldp.eth0.port.descr'] == 'eth1'
assert out['lldp.eth0.port.power.device-type'] == 'PSE'
links(namespaces(1), namespaces(2))
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth2.port.descr'] == 'eth3'
with namespaces(1):
out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")
assert out['lldp.eth2.port.descr'] == 'eth3'