fix: an unknown ARP age is -1.0, not 0.0
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 23s
driver / types (pull_request) Successful in 1m24s
driver / test (3.12) (pull_request) Successful in 3m53s
driver / test (3.13) (pull_request) Successful in 3m37s
driver / lowest (pull_request) Successful in 3m14s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m11s
CI / driver (pull_request) Successful in 5m45s
driver / publish (pull_request) Skipped

The host list says a host is active, not when the gateway last saw it, so
get_arp_table reports ARP_AGE_UNKNOWN instead of 0.0 ("confirmed just now").

NetOrk/netork#1327
This commit is contained in:
Christian Manivong committed 2026-10-30 08:37:08 +01:00
1 parent d0f2576510
commit 48fdda1904
3 files changed
+25 -2

No files matched your search

+14
View File
@@ -278,6 +278,20 @@ class TestZyxelVMGDriver:
self._setup_mocked_http()
assert self.driver.get_arp_table() == []
def test_an_arp_entry_has_no_known_age(self):
"""The host list says a host is active, not when the gateway last saw it;
0.0 would read as "confirmed just now" (NetOrk/netork#1327)."""
self.driver.get_hosts = lambda: [
{
"mac": "aa:bb:cc:dd:ee:ff",
"ip": "192.168.1.33",
"hostname": "laptop",
"interface_type": "lan",
"is_active": True,
}
]
assert [e["age"] for e in self.driver.get_arp_table()] == [-1.0]
def test_reboot_host_is_the_contract_the_application_calls(self):
"""It was reboot(), which nothing looks for: the gateway could not be
restarted from the application (#5)."""