netbox-agent/tests/network.py

21 lines
529 B
Python
Raw Normal View History

2020-02-02 20:08:56 +01:00
from netbox_agent.lldp import LLDP
from tests.conftest import parametrize_with_fixtures
@parametrize_with_fixtures(
'lldp/', only_filenames=[
'dedibox1.txt',
])
2020-02-05 11:54:35 +01:00
def test_lldp_parse_with_port_desc(dmi_fixture):
lldp = LLDP(dmi_fixture)
2020-02-02 20:08:56 +01:00
assert lldp.get_switch_port('enp1s0f0') == 'RJ-9'
@parametrize_with_fixtures(
'lldp/', only_filenames=[
'qfx.txt',
])
2020-02-05 11:54:35 +01:00
def test_lldp_parse_without_ifname(dmi_fixture):
lldp = LLDP(dmi_fixture)
2020-02-02 20:08:56 +01:00
assert lldp.get_switch_port('eth0') == 'xe-0/0/1'