diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-19 09:59:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-02-11 11:44:19 +0000 |
commit | 261a1409b1dad8673bc9de68c2ee949e2ec1ca0b (patch) | |
tree | f42bc851a52463f1d2b4b7ffdca8c7e7651a4af3 /meta/lib/oeqa/runtime/case.py | |
parent | a24b1786664ce8086f4e5b40843adc35bb2de736 (diff) | |
download | poky-261a1409b1dad8673bc9de68c2ee949e2ec1ca0b.tar.gz |
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>
Diffstat (limited to 'meta/lib/oeqa/runtime/case.py')
-rw-r--r-- | meta/lib/oeqa/runtime/case.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/case.py b/meta/lib/oeqa/runtime/case.py index f036982e1f..9515ca2f3d 100644 --- a/meta/lib/oeqa/runtime/case.py +++ b/meta/lib/oeqa/runtime/case.py | |||
@@ -4,6 +4,9 @@ | |||
4 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
5 | # | 5 | # |
6 | 6 | ||
7 | import os | ||
8 | import subprocess | ||
9 | import time | ||
7 | from oeqa.core.case import OETestCase | 10 | from oeqa.core.case import OETestCase |
8 | from oeqa.utils.package_manager import install_package, uninstall_package | 11 | from oeqa.utils.package_manager import install_package, uninstall_package |
9 | 12 | ||
@@ -18,3 +21,16 @@ class OERuntimeTestCase(OETestCase): | |||
18 | def tearDown(self): | 21 | def tearDown(self): |
19 | super(OERuntimeTestCase, self).tearDown() | 22 | super(OERuntimeTestCase, self).tearDown() |
20 | uninstall_package(self) | 23 | uninstall_package(self) |
24 | |||
25 | def run_network_serialdebug(runner): | ||
26 | status, output = runner.run_serial("ip addr") | ||
27 | print("ip addr on target: %s %s" % (output, status)) | ||
28 | status, output = runner.run_serial("ping -c 1 %s" % self.target.server_ip) | ||
29 | print("ping on target for %s: %s %s" % (self.target.server_ip, output, status)) | ||
30 | status, output = runner.run_serial("ping -c 1 %s" % self.target.ip) | ||
31 | print("ping on target for %s: %s %s" % (self.target.ip, output, status)) | ||
32 | # Have to use a full path for netstat which isn't in HOSTTOOLS | ||
33 | subprocess.call(["/usr/bin/netstat", "-tunape"]) | ||
34 | subprocess.call(["/usr/bin/netstat", "-ei"]) | ||
35 | subprocess.call(["ps", "-awx"], shell=True) | ||
36 | print("PID: %s %s" % (str(os.getpid()), time.time())) | ||