mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
qa: Strip prefix length from NetBSD ifconfig output
Modern NetBSD `ifconfig` prints interface addresses in CIDR notation (e.g. `inet 127.0.0.1/8`), unlike the other supported platforms which print the netmask as a separate field. The trailing prefix length breaks functional tests that expect a plain IP address. This change is a no-op on other platforms.
This commit is contained in:
@@ -149,7 +149,7 @@ def all_interfaces():
|
||||
return [
|
||||
(m["iface"].encode(), ip)
|
||||
for m in re.finditer(r"(?m)^(?P<iface>\S+):(?P<block>[^\n]*(?:\n[ \t]+[^\n]*)*)", output)
|
||||
for ip in re.findall(r"inet (\S+)", m["block"])
|
||||
for ip in re.findall(r"inet ([^\s/]+)", m["block"])
|
||||
]
|
||||
else:
|
||||
raise NotImplementedError(f"all_interfaces is not supported on {sys.platform}")
|
||||
|
||||
Reference in New Issue
Block a user