Merge pull request 'fix: an unknown ARP age is -1.0, not 0.0' (#23) from fix/arp-unknown-age into main
driver / standard (push) Successful in 22s
driver / lint (push) Successful in 14s
driver / test (3.12) (push) Successful in 1m15s
driver / types (push) Successful in 1m17s
driver / lowest (push) Successful in 32s
driver / test (3.13) (push) Successful in 1m21s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m13s
CI / driver (push) Successful in 3m5s
driver / publish (push) Skipped
driver / standard (push) Successful in 22s
driver / lint (push) Successful in 14s
driver / test (3.12) (push) Successful in 1m15s
driver / types (push) Successful in 1m17s
driver / lowest (push) Successful in 32s
driver / test (3.13) (push) Successful in 1m21s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m13s
CI / driver (push) Successful in 3m5s
driver / publish (push) Skipped
This commit was merged in pull request #23.
This commit is contained in:
commit
d78a55dd1a
3 files changed
+20
-2
No files matched your search
@@ -13,6 +13,11 @@ recorded here; their history is the git log.
|
||||
- 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": neither
|
||||
`ip neigh` nor `/proc/net/arp` has an age (NetOrk/netork#1327).
|
||||
|
||||
## [0.7.0] - 2026-10-23
|
||||
|
||||
The first release on PyPI.
|
||||
|
||||
@@ -234,7 +234,7 @@ class OpenWrtInterfaceMixin:
|
||||
"interface": interface,
|
||||
"mac": mac_addr,
|
||||
"ip": ip_addr,
|
||||
"age": 0.0,
|
||||
"age": -1.0, # no age reported: unknown, never 0.0 ("just now")
|
||||
}
|
||||
)
|
||||
continue
|
||||
@@ -267,7 +267,7 @@ class OpenWrtInterfaceMixin:
|
||||
"interface": interface,
|
||||
"mac": mac_addr,
|
||||
"ip": ip_addr,
|
||||
"age": 0.0,
|
||||
"age": -1.0, # no age reported: unknown, never 0.0 ("just now")
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -274,6 +274,19 @@ class TestGetArpTable:
|
||||
assert "192.168.1.100" in ips
|
||||
assert "192.168.1.101" in ips
|
||||
|
||||
def test_ip_neigh_reports_no_age(self, driver):
|
||||
# REACHABLE or STALE, `ip neigh` says nothing about when the neighbour
|
||||
# was last confirmed; 0.0 would read as "just now" (NetOrk/netork#1327).
|
||||
driver._send_command = lambda cmd, **kw: IP_NEIGH_SHOW
|
||||
assert {e["age"] for e in driver.get_arp_table()} == {-1.0}
|
||||
|
||||
def test_proc_net_arp_reports_no_age(self, driver):
|
||||
driver._send_command = lambda cmd, **kw: (
|
||||
"IP address HW type Flags HW address Mask Device\n"
|
||||
"192.168.1.100 0x1 0x2 aa:bb:cc:dd:ee:ff * br-lan\n"
|
||||
)
|
||||
assert [e["age"] for e in driver.get_arp_table()] == [-1.0]
|
||||
|
||||
|
||||
class TestGetMacAddressTable:
|
||||
def test_returns_list(self, driver):
|
||||
|
||||
Reference in new issue
Block a user