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:
Hennadii Stepanov
2026-06-26 16:37:46 +01:00
parent 1c1735567e
commit 70352fda03

View File

@@ -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}")