diff --git a/tests/integration/test_basic.py b/tests/integration/test_basic.py index b8cd49b1faa489aa419fb20ce5a89aa61ae55bc7..45b87b1eee2e0ae50c76b983ed2036d2509a4d1f 100644 --- a/tests/integration/test_basic.py +++ b/tests/integration/test_basic.py @@ -4,7 +4,7 @@ import pyroute2 import scapy.all import scapy.contrib.lldp -def test_one_neighbor(lldpd1, lldpd, lldpcli, namespaces): +def test_one_neighbor(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() with namespaces(1): @@ -47,7 +47,7 @@ def test_several_neighbors(lldpd, lldpcli, links, namespaces, neighbors): 'ns-{}.example.com'.format(i) -def test_one_interface(lldpd1, lldpd, lldpcli, namespaces): +def test_one_interface(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() with namespaces(1): @@ -100,7 +100,7 @@ def test_different_mtu(lldpd, lldpcli, links, namespaces): assert out['lldp.eth2.chassis.mac'] == '00:00:00:00:00:01' -def test_overrided_description(lldpd1, lldpd, lldpcli, namespaces): +def test_overrided_description(lldpd, lldpcli, namespaces): with namespaces(2): lldpd("-S", "Modified description") with namespaces(1): @@ -108,7 +108,7 @@ def test_overrided_description(lldpd1, lldpd, lldpcli, namespaces): assert out['lldp.eth0.chassis.descr'] == "Modified description" -def test_overrided_description2(lldpd1, lldpd, lldpcli, namespaces): +def test_overrided_description2(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() lldpcli("configure", "system", "description", "Modified description") @@ -119,7 +119,7 @@ def test_overrided_description2(lldpd1, lldpd, lldpcli, namespaces): assert out['lldp.eth0.chassis.descr'] == "Modified description" -def test_overrided_chassisid(lldpd1, lldpd, lldpcli, namespaces): +def test_overrided_chassisid(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() lldpcli("configure", "system", "chassisid", "Modified chassis ID") @@ -130,7 +130,7 @@ def test_overrided_chassisid(lldpd1, lldpd, lldpcli, namespaces): assert out['lldp.eth0.chassis.local'] == "Modified chassis ID" -def test_overrided_chassisid_kept(lldpd1, lldpd, lldpcli, namespaces, links): +def test_overrided_chassisid_kept(lldpd, lldpcli, namespaces, links): with namespaces(2): lldpd() lldpcli("configure", "system", "chassisid", "Modified chassis ID") @@ -145,7 +145,7 @@ def test_overrided_chassisid_kept(lldpd1, lldpd, lldpcli, namespaces, links): assert out['lldp.eth0.chassis.local'] == "Modified chassis ID" -def test_overrided_chassisid_reverse(lldpd1, lldpd, lldpcli, namespaces): +def test_overrided_chassisid_reverse(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() lldpcli("configure", "system", "chassisid", "Modified chassis ID") @@ -157,7 +157,7 @@ def test_overrided_chassisid_reverse(lldpd1, lldpd, lldpcli, namespaces): assert out['lldp.eth0.chassis.mac'] == "00:00:00:00:00:02" -def test_hide_kernel(lldpd1, lldpd, lldpcli, namespaces): +def test_hide_kernel(lldpd, lldpcli, namespaces): with namespaces(2): lldpd("-k") with namespaces(1): @@ -166,7 +166,7 @@ def test_hide_kernel(lldpd1, lldpd, lldpcli, namespaces): "Spectacular GNU/Linux 2016" -def test_listen_only(lldpd1, lldpd, lldpcli, namespaces): +def test_listen_only(lldpd, lldpcli, namespaces): with namespaces(2): lldpd("-r") with namespaces(1): @@ -174,7 +174,7 @@ def test_listen_only(lldpd1, lldpd, lldpcli, namespaces): assert out == {} -def test_forced_unknown_management_address(lldpd1, lldpd, lldpcli, namespaces): +def test_forced_unknown_management_address( lldpd, lldpcli, namespaces): with namespaces(2): lldpd("-m", "2001:db8::47") with namespaces(1): @@ -183,7 +183,7 @@ def test_forced_unknown_management_address(lldpd1, lldpd, lldpcli, namespaces): assert "lldp.eth0.chassis.mgmt-iface" not in out -def test_forced_known_management_address(lldpd1, lldpd, lldpcli, namespaces): +def test_forced_known_management_address(lldpd, lldpcli, namespaces): with namespaces(2): ipr = pyroute2.IPRoute() idx = ipr.link_lookup(ifname="eth1")[0] @@ -195,7 +195,7 @@ def test_forced_known_management_address(lldpd1, lldpd, lldpcli, namespaces): assert out["lldp.eth0.chassis.mgmt-iface"] == "2" -def test_management_address(lldpd1, lldpd, lldpcli, links, namespaces): +def test_management_address(lldpd, lldpcli, links, namespaces): with namespaces(2): ipr = pyroute2.IPRoute() idx = ipr.link_lookup(ifname="eth1")[0] @@ -208,7 +208,7 @@ def test_management_address(lldpd1, lldpd, lldpcli, links, namespaces): assert out["lldp.eth0.chassis.mgmt-iface"] == "2" -def test_management_interface(lldpd1, lldpd, lldpcli, links, namespaces): +def test_management_interface(lldpd, lldpcli, links, namespaces): links(namespaces(1), namespaces(2), 4) with namespaces(2): ipr = pyroute2.IPRoute() @@ -224,7 +224,7 @@ def test_management_interface(lldpd1, lldpd, lldpcli, links, namespaces): assert out["lldp.eth0.chassis.mgmt-iface"] == ["4", "4"] -def test_change_management_address(lldpd1, lldpd, lldpcli, links, namespaces): +def test_change_management_address(lldpd, lldpcli, links, namespaces): with namespaces(2): ipr = pyroute2.IPRoute() idx = ipr.link_lookup(ifname="eth1")[0] @@ -247,7 +247,7 @@ def test_change_management_address(lldpd1, lldpd, lldpcli, links, namespaces): assert out["lldp.eth0.chassis.mgmt-iface"] == "2" -def test_portid_subtype_ifname(lldpd1, lldpd, lldpcli, namespaces): +def test_portid_subtype_ifname(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() lldpcli("configure", "lldp", "portidsubtype", "ifname") @@ -258,7 +258,7 @@ def test_portid_subtype_ifname(lldpd1, lldpd, lldpcli, namespaces): assert out["lldp.eth0.port.descr"] == "eth1" -def test_portid_subtype_with_alias(lldpd1, lldpd, lldpcli, links, namespaces): +def test_portid_subtype_with_alias(lldpd, lldpcli, links, namespaces): with namespaces(2): ipr = pyroute2.IPRoute() idx = ipr.link_lookup(ifname="eth1")[0] @@ -270,7 +270,7 @@ def test_portid_subtype_with_alias(lldpd1, lldpd, lldpcli, links, namespaces): assert out["lldp.eth0.port.descr"] == "alias of eth1" -def test_portid_subtype_macaddress(lldpd1, lldpd, lldpcli, links, namespaces): +def test_portid_subtype_macaddress(lldpd, lldpcli, links, namespaces): with namespaces(2): ipr = pyroute2.IPRoute() idx = ipr.link_lookup(ifname="eth1")[0] @@ -284,7 +284,7 @@ def test_portid_subtype_macaddress(lldpd1, lldpd, lldpcli, links, namespaces): assert out["lldp.eth0.port.descr"] == "eth1" -def test_portid_subtype_local(lldpd1, lldpd, lldpcli, namespaces): +def test_portid_subtype_local(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() lldpcli("configure", "lldp", "portidsubtype", "local", "localname") @@ -295,7 +295,7 @@ def test_portid_subtype_local(lldpd1, lldpd, lldpcli, namespaces): assert out["lldp.eth0.port.descr"] == "eth1" -def test_portid_subtype_local_with_description(lldpd1, lldpd, lldpcli, namespaces): +def test_portid_subtype_local_with_description(lldpd, lldpcli, namespaces): with namespaces(2): lldpd() lldpcli("configure", "lldp", "portidsubtype", "local", "localname", "description", "localdescription") @@ -306,7 +306,7 @@ def test_portid_subtype_local_with_description(lldpd1, lldpd, lldpcli, namespace assert out["lldp.eth0.port.descr"] == "localdescription" -def test_portdescription(lldpd1, lldpd, lldpcli, namespaces): +def test_portdescription( lldpd, lldpcli, namespaces): with namespaces(2): lldpd() lldpcli("configure", "lldp", "portdescription", "localdescription") @@ -316,7 +316,7 @@ def test_portdescription(lldpd1, lldpd, lldpcli, namespaces): assert out["lldp.eth0.port.descr"] == "localdescription" -def test_portid_subtype_local_with_alias(lldpd1, lldpd, lldpcli, namespaces): +def test_portid_subtype_local_with_alias(lldpd, lldpcli, namespaces): with namespaces(2): ipr = pyroute2.IPRoute() idx = ipr.link_lookup(ifname="eth1")[0] @@ -394,7 +394,7 @@ def test_port_status_disabled(lldpd, lldpcli, namespaces, links): assert out == {} -def test_port_vlan_tx(lldpd1, lldpd, lldpcli, namespaces): +def test_port_vlan_tx(lldpd, lldpcli, namespaces): with namespaces(1): lldpd() lldpcli("configure", "ports", "eth0", "lldp", "vlan-tx", "100", "priority", "5", "dei", "1") @@ -410,7 +410,7 @@ def test_port_vlan_tx(lldpd1, lldpd, lldpcli, namespaces): assert not "lldp.eth0.port.vlanTX.dei" in out -def test_set_interface_alias(lldpd1, lldpd, lldpcli, namespaces): +def test_set_interface_alias(lldpd, lldpcli, namespaces): with namespaces(1): lldpcli("configure", "system", "interface", "description") with namespaces(2):