From: Peter Marko Date: Tue, 13 Jan 2026 08:54:44 +0000 (+0100) Subject: oeqa-runtime: avoid crash in run_network_serialdebug for missing netstat X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82c9d870df671d08d56df2ed1a124f6e5e43601f;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git oeqa-runtime: avoid crash in run_network_serialdebug for missing netstat If netstat is not installed on the host, the function fails. Signed-off-by: Peter Marko Signed-off-by: Antonin Godard Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/runtime/case.py b/meta/lib/oeqa/runtime/case.py index 095bcf434a..23796c0cdf 100644 --- a/meta/lib/oeqa/runtime/case.py +++ b/meta/lib/oeqa/runtime/case.py @@ -32,7 +32,10 @@ def run_network_serialdebug(target): status, output = target.runner.run_serial("ping -c 1 %s" % target.ip) print("ping on target for %s: %s %s" % (target.ip, output, status)) # Have to use a full path for netstat which isn't in HOSTTOOLS - subprocess.call(["/usr/bin/netstat", "-tunape"]) - subprocess.call(["/usr/bin/netstat", "-ei"]) + try: + subprocess.call(["/usr/bin/netstat", "-tunape"]) + subprocess.call(["/usr/bin/netstat", "-ei"]) + except (OSError, subprocess.SubprocessError) as e: + print("netstat failed: %s" % e) subprocess.call(["ps", "-awx"], shell=True) print("PID: %s %s" % (str(os.getpid()), time.time()))