From 3f1bb159d53ea76a6e99cdcc083b201d78f0a722 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Fri, 30 Oct 2026 08:37:08 +0100 Subject: [PATCH] fix: an unknown ARP age is -1.0, not 0.0 show arp has no age column, so get_arp_table reports ARP_AGE_UNKNOWN instead of 0.0 ("confirmed just now"). NetOrk/netork#1327 --- CHANGELOG.md | 5 +++++ napalm_tplink_jetstream/tplink_jetstream.py | 2 +- tests/unit/test_driver.py | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca8f58a..c4c7df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,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 402ab8a..e404423 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()} -- 2.54.1