1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-17 04:07:06 +00:00

oeqa/runtime: Add debugging if networking fails

If networking fails, we can get useful informaiton over the serial connection. Add
this fallback code so that any issues can be more easily debugged by showing the
host and target networking states.

(From OE-Core rev: 3291f9d07ecfe7d3301dc914f5e6a80577cf1d5d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2024-10-19 09:59:21 +01:00
parent a24b178666
commit 261a1409b1
3 changed files with 20 additions and 2 deletions
+16
View File
@@ -4,6 +4,9 @@
# SPDX-License-Identifier: MIT
#
import os
import subprocess
import time
from oeqa.core.case import OETestCase
from oeqa.utils.package_manager import install_package, uninstall_package
@@ -18,3 +21,16 @@ class OERuntimeTestCase(OETestCase):
def tearDown(self):
super(OERuntimeTestCase, self).tearDown()
uninstall_package(self)
def run_network_serialdebug(runner):
status, output = runner.run_serial("ip addr")
print("ip addr on target: %s %s" % (output, status))
status, output = runner.run_serial("ping -c 1 %s" % self.target.server_ip)
print("ping on target for %s: %s %s" % (self.target.server_ip, output, status))
status, output = runner.run_serial("ping -c 1 %s" % self.target.ip)
print("ping on target for %s: %s %s" % (self.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"])
subprocess.call(["ps", "-awx"], shell=True)
print("PID: %s %s" % (str(os.getpid()), time.time()))