fix: an unknown ARP age is -1.0, not 0.0 #11
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -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()}
|
||||
|
||||
Reference in new issue
Block a user