From cc9752499ea38ef711955a811186480fb2f41940 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Fri, 30 Oct 2026 08:37:08 +0100 Subject: [PATCH] fix: an unknown IPv6 neighbour age is -1.0, not 0.0 get_ipv6_neighbors_table reports ARP_AGE_UNKNOWN, as get_arp_table already did, instead of 0.0 ("confirmed just now"). NetOrk/netork#1327 --- CHANGELOG.md | 5 +++++ napalm_proxmox/interfaces_mixin.py | 6 ++++-- tests/test_misc.py | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f7371..ab3fc6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 the task — the contracts `HostShutdownMixin` and `VmStopRequestMixin` of napalm-device-types (NetOrk/netork#1636). +### Fixed +- `get_ipv6_neighbors_table()` reports an unknown age as `-1.0`, as `get_arp_table()` + already did (napalm-device-types' `ARP_AGE_UNKNOWN`), instead of `0.0`, which + means "confirmed just now" (NetOrk/netork#1327). + ## [0.8.0] - 2026-10-23 The first release on PyPI. It collects everything since 0.1.0. diff --git a/napalm_proxmox/interfaces_mixin.py b/napalm_proxmox/interfaces_mixin.py index c8a19f9..0868e37 100644 --- a/napalm_proxmox/interfaces_mixin.py +++ b/napalm_proxmox/interfaces_mixin.py @@ -148,8 +148,10 @@ class ProxmoxInterfaceMixin: "interface": iface, "mac": utils.normalize_mac(mac), "ip": parts[0], - # `ip neigh` reports no age; NAPALM's shape requires the key. - "age": 0.0, + # `ip neigh` reports no age; NAPALM's shape requires the key, + # and -1.0 is napalm-device-types' ARP_AGE_UNKNOWN -- 0.0 + # would mean "confirmed just now". + "age": -1.0, "state": state, } ) diff --git a/tests/test_misc.py b/tests/test_misc.py index a8fd6c2..42a660e 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -320,6 +320,13 @@ class TestIPv6Neighbors: states = {e["state"] for e in result} assert "REACHABLE" in states + def test_age_is_unknown(self, driver): + # `ip neigh` reports no age, as for the IPv4 table; 0.0 would read as + # "confirmed just now" (NetOrk/netork#1327). + driver._node_api().execute.post.return_value = {"data": self.IPV6_NEIGH} + result = driver.get_ipv6_neighbors_table() + assert {e["age"] for e in result} == {-1.0} + class TestNotImplemented: def test_get_bgp_config_raises(self, driver):