diff --git a/CHANGELOG.md b/CHANGELOG.md index 77a221b..388da34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ All notable changes to this driver. The format follows - The floor on napalm is 5.1: older releases import `pkg_resources`, which a Python 3.12 venv no longer has. +### Fixed +- `get_arp_table()` reports an unknown age as `-1.0` (napalm-device-types' + `ARP_AGE_UNKNOWN`) instead of `0.0`, which means "confirmed just now": `show arp` + has no age column (NetOrk/netork#1327). + ## [0.5.0] - 2026-10-23 The first release on PyPI through the shared workflow; 0.1.0 and 0.1.1 there are an old upload. diff --git a/napalm_tplink_jetstream/tplink_jetstream.py b/napalm_tplink_jetstream/tplink_jetstream.py index c20ccd9..a285552 100644 --- a/napalm_tplink_jetstream/tplink_jetstream.py +++ b/napalm_tplink_jetstream/tplink_jetstream.py @@ -634,7 +634,7 @@ class TPLinkJetstreamDriver(ConfigLifecycleMixin, SnmpAgentMixin, SwitchDriver): "interface": interface, "mac": mac_addr, "ip": ip_addr, - "age": 0.0, + "age": -1.0, # no age column: unknown, never 0.0 ("just now") } ) diff --git a/tests/unit/test_driver.py b/tests/unit/test_driver.py index 5294fa8..95d4b14 100644 --- a/tests/unit/test_driver.py +++ b/tests/unit/test_driver.py @@ -177,6 +177,11 @@ class TestGetArpTable: for key in ("interface", "mac", "ip", "age"): assert key in entry + def test_age_is_unknown(self, driver): + # `show arp` has no age column; 0.0 would read as "just now" (NetOrk/netork#1327). + driver._send_command = lambda cmd: SHOW_ARP + assert {e["age"] for e in driver.get_arp_table()} == {-1.0} + def test_ip_value(self, driver): driver._send_command = lambda cmd: SHOW_ARP ips = {e["ip"] for e in driver.get_arp_table()}