fix: an unknown ARP age is -1.0, not 0.0
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Successful in 1m1s
driver / types (pull_request) Successful in 1m7s
driver / test (3.13) (pull_request) Successful in 57s
driver / lowest (pull_request) Successful in 30s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 2m42s
driver / publish (pull_request) Skipped

get_arp_table on Smart switches wrote 0.0 ("confirmed just now") and
ignored the "Age (min)" column of show arp. It now reports ARP_AGE_UNKNOWN;
parsing the column waits for real switch output, since the docstring
example and the test fixture are not taken from a switch.

NetOrk/netork#1327
This commit is contained in:
Christian Manivong committed 2026-10-30 08:37:08 +01:00
1 parent c4facc1105
commit 7b179383c6
3 files changed
+16 -3

No files matched your search

+3 -3
View File
@@ -894,9 +894,9 @@ class NetgearSmartDriver(ConfigLifecycleMixin, SnmpAgentMixin, SwitchDriver):
return configs
def get_arp_table(self, vrf: str = "") -> list[dict]:
"""Return the ARP table.
"""Return the ARP table. ``age`` is -1.0 (napalm-device-types' ``ARP_AGE_UNKNOWN``).
Example ``show arp`` output::
Example ``show arp`` output (not from a real switch: "Age (min)" waits for one)::
IP Address MAC Address Interface Age (min) Type
--------- ---------------- --------- --------- -------
@@ -940,7 +940,7 @@ class NetgearSmartDriver(ConfigLifecycleMixin, SnmpAgentMixin, SwitchDriver):
"interface": interface,
"mac": mac_addr,
"ip": ip_addr,
"age": 0.0,
"age": -1.0, # unknown, never 0.0 ("just now")
}
)