netbox-agent/tests/network.py

25 lines
525 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(
2024-10-21 12:55:54 +02:00
"lldp/",
only_filenames=[
"dedibox1.txt",
],
)
2020-02-02 20:08:56 +01:00
def test_lldp_parse_with_port_desc(fixture):
lldp = LLDP(fixture)
2024-10-21 12:55:54 +02:00
assert lldp.get_switch_port("enp1s0f0") == "RJ-9"
2020-02-02 20:08:56 +01:00
@parametrize_with_fixtures(
2024-10-21 12:55:54 +02:00
"lldp/",
only_filenames=[
"qfx.txt",
],
)
2020-02-02 20:08:56 +01:00
def test_lldp_parse_without_ifname(fixture):
lldp = LLDP(fixture)
2024-10-21 12:55:54 +02:00
assert lldp.get_switch_port("eth0") == "xe-0/0/1"