qa: Support `get_bind_addrs` and `feature_bind_extra` on illumos
What changed, and why it matters
This is a small test-only change that lets Bitcoin Core's internal test tools recognize the illumos operating system (reported as 'sunos5') when listing network addresses and interfaces. It does not change the Bitcoin node software itself, does not touch wallet or consensus code, and has no direct security relevance.
No security action needed. Treat as ordinary QA/platform-compatibility maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/test_framework/netutil.py to include ‘sunos5’ (the Python sys.platform prefix for illumos) in the platform checks used by get_bind_addrs() and all_interfaces(). These helpers are only used by the functional test framework to discover which addresses a test node has bound. The change adds illumos to the same code paths already used for macOS, FreeBSD, NetBSD, and OpenBSD, and enables the same lsof -Di flag used on FreeBSD/NetBSD. No runtime Bitcoin Core behavior is affected.
Changed components
test/functional/test_framework/netutil.pyInspect captured patch +4 / −4
diff --git a/test/functional/test_framework/netutil.py b/test/functional/test_framework/netutil.py
index 748fb049..352efac8 100644
--- a/test/functional/test_framework/netutil.py
+++ b/test/functional/test_framework/netutil.py
@@ -2,7 +2,7 @@
# Copyright (c) 2014-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-"""Linux, macOS, and BSD network utilities.
+"""Linux, macOS, BSD and illumos network utilities.
Roughly based on https://web.archive.org/web/20190424172231/http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal
"""
@@ -96,11 +96,11 @@ def get_bind_addrs(pid):
bind_addrs.append(conn[1])
return bind_addrs
# OpenBSD is not included, as it does not ship the lsof utility.
- elif sys.platform.startswith(("darwin", "freebsd", "netbsd")):
+ elif sys.platform.startswith(("darwin", "freebsd", "netbsd", "sunos5")):
import re
import subprocess
output = subprocess.check_output(["lsof",
- *(["-Di"] if sys.platform.startswith(("freebsd", "netbsd")) else []), # Ignore device cache to avoid stderr warnings.
+ *(["-Di"] if sys.platform.startswith(("freebsd", "netbsd", "sunos5")) else []), # Ignore device cache to avoid stderr warnings.
*(["-w"] if sys.platform.startswith("netbsd") else []), # Ignore point release mismatch warnings.
"-nP", # Keep hosts and ports numeric.
"-a", # Require all filters to match.
@@ -143,7 +143,7 @@ def all_interfaces():
return [(namestr[i:i+16].split(b'\0', 1)[0],
socket.inet_ntoa(namestr[i+20:i+24]))
for i in range(0, outbytes, struct_size)]
- elif sys.platform.startswith(("darwin", "freebsd", "netbsd", "openbsd")):
+ elif sys.platform.startswith(("darwin", "freebsd", "netbsd", "openbsd", "sunos5")):
import re
import subprocess
output = subprocess.check_output(["ifconfig", "-au"], text=True)
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.