]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tests: use prefixlen instead of mask with pyroute2
authorVincent Bernat <vincent@bernat.ch>
Thu, 8 Dec 2022 18:08:04 +0000 (19:08 +0100)
committerVincent Bernat <vincent@bernat.ch>
Thu, 8 Dec 2022 18:08:04 +0000 (19:08 +0100)
tests/integration/test_basic.py
tests/integration/test_protocols.py

index d237f219444820bde0276ed8d2aa910f65a58885..9dd34803be1b992f4cff41ae51ab87e76ac96977 100644 (file)
@@ -195,7 +195,7 @@ def test_forced_known_management_address(lldpd1, lldpd, lldpcli, namespaces):
     with namespaces(2):
         with pyroute2.IPRoute() as ipr:
             idx = ipr.link_lookup(ifname="eth1")[0]
-            ipr.addr("add", index=idx, address="192.168.14.2", mask=24)
+            ipr.addr("add", index=idx, address="192.168.14.2", prefixlen=24)
         lldpd("-m", "192.168.14.2")
     with namespaces(1):
         out = lldpcli("-f", "keyvalue", "show", "neighbors")
@@ -207,8 +207,8 @@ def test_management_address(lldpd1, lldpd, lldpcli, links, namespaces):
     with namespaces(2):
         with pyroute2.IPRoute() as ipr:
             idx = ipr.link_lookup(ifname="eth1")[0]
-            ipr.addr("add", index=idx, address="192.168.14.2", mask=24)
-            ipr.addr("add", index=idx, address="172.25.21.47", mask=24)
+            ipr.addr("add", index=idx, address="192.168.14.2", prefixlen=24)
+            ipr.addr("add", index=idx, address="172.25.21.47", prefixlen=24)
         lldpd("-m", "172.25.*")
     with namespaces(1):
         out = lldpcli("-f", "keyvalue", "show", "neighbors")
@@ -221,9 +221,9 @@ def test_management_interface(lldpd1, lldpd, lldpcli, links, namespaces):
     with namespaces(2):
         with pyroute2.IPRoute() as ipr:
             idx = ipr.link_lookup(ifname="eth1")[0]
-            ipr.addr("add", index=idx, address="192.168.14.2", mask=24)
+            ipr.addr("add", index=idx, address="192.168.14.2", prefixlen=24)
             idx = ipr.link_lookup(ifname="eth3")[0]
-            ipr.addr("add", index=idx, address="172.25.21.47", mask=24)
+            ipr.addr("add", index=idx, address="172.25.21.47", prefixlen=24)
         lldpd("-m", "eth3")
     with namespaces(1):
         out = lldpcli("-f", "keyvalue", "show", "neighbors")
@@ -238,7 +238,7 @@ def test_change_management_address(lldpd1, lldpd, lldpcli, links, namespaces):
     with namespaces(2):
         with pyroute2.IPRoute() as ipr:
             idx = ipr.link_lookup(ifname="eth1")[0]
-            ipr.addr("add", index=idx, address="192.168.14.2", mask=24)
+            ipr.addr("add", index=idx, address="192.168.14.2", prefixlen=24)
         lldpd("-m", "192.168.*")
         # We need a short TX interval as updating the IP address
         # doesn't trigger a resend.
@@ -249,8 +249,8 @@ def test_change_management_address(lldpd1, lldpd, lldpcli, links, namespaces):
         assert out["lldp.eth0.chassis.mgmt-iface"] == "2"
     with namespaces(2):
         with pyroute2.IPRoute() as ipr:
-            ipr.addr("del", index=idx, address="192.168.14.2", mask=24)
-            ipr.addr("add", index=idx, address="192.168.14.5", mask=24)
+            ipr.addr("del", index=idx, address="192.168.14.2", prefixlen=24)
+            ipr.addr("add", index=idx, address="192.168.14.5", prefixlen=24)
         time.sleep(5)
     with namespaces(1):
         out = lldpcli("-f", "keyvalue", "show", "neighbors")
index 6169cdfe74c1e52d9ca0f6e4726c920a6f7fc5c4..871649ae25b4a8f19cb9849fba24eaa9fe8c3e80 100644 (file)
@@ -68,7 +68,7 @@ def test_sonmp(lldpd, lldpcli, links, namespaces):
     with namespaces(2):
         with pyroute2.IPRoute() as ipr:
             idx = ipr.link_lookup(ifname="eth1")[0]
-            ipr.addr("add", index=idx, address="192.168.14.2", mask=24)
+            ipr.addr("add", index=idx, address="192.168.14.2", prefixlen=24)
         lldpd("-ss", "-ll")
     with namespaces(1):
         out = lldpcli("-f", "keyvalue", "show", "neighbors", "details")