fix: an ARP entry's expiry is no age
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m6s
driver / test (3.12) (pull_request) Successful in 1m27s
driver / lowest (pull_request) Successful in 37s
driver / test (3.13) (pull_request) Successful in 1m27s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m12s
CI / driver (pull_request) Successful in 3m12s
driver / publish (pull_request) Skipped

get_arp_table and get_ipv6_neighbors_table reported expires, the seconds
left until the entry expires: an entry refreshed a second ago looked 20
minutes old. Both now report ARP_AGE_UNKNOWN (-1.0).

NetOrk/netork#1327
This commit is contained in:
Christian Manivong committed 2026-10-30 08:37:08 +01:00
1 parent 0176656743
commit bb0810d693
3 files changed
+19 -4

No files matched your search

+11
View File
@@ -343,6 +343,13 @@ class TestGetInterfacesIp:
class TestGetArpTable:
def test_expires_is_not_an_age(self, driver):
"""``expires`` counts down to the entry's expiry; it says nothing about
when the neighbour was last confirmed. Reported as the age, an entry
refreshed a second ago looked 20 minutes old (NetOrk/netork#1327)."""
driver._get = lambda path: ARP_RESPONSE
assert {e["age"] for e in driver.get_arp_table()} == {-1.0}
def test_entry_count(self, driver):
driver._get = lambda path: ARP_RESPONSE
table = driver.get_arp_table()
@@ -681,6 +688,10 @@ class TestGetIpv6NeighborsTable:
driver._get = lambda path: {"rows": []}
assert driver.get_ipv6_neighbors_table() == []
def test_expires_is_not_an_age(self, driver):
driver._get = lambda path: NDP_RESPONSE
assert {e["age"] for e in driver.get_ipv6_neighbors_table()} == {-1.0}
# ---------------------------------------------------------------------------
# get_lldp_neighbors() / get_lldp_neighbors_detail()