1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

testimage: Drop target_dumper and most of monitor_dumper

The target_dumper code is basically broken. It has been reading binary files
over the text base serial communication and runs at every command failure which
makes no sense. Each run might overwrite files from the previous run and the
output appears corrupted due to confusion from the binary data.

For now, remove the commands and the target dumper code as the command
and execution point are problematic. Also remove the same pieces of the monitor
code but leave the command list since in theory this can be moved to a more
useful place in the code.

(From OE-Core rev: a24d787987dccc95fdd95b7e85bf525a1c55b285)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2023-12-19 16:04:24 +00:00
parent 2ad6a0be02
commit 08369812c1
4 changed files with 1 additions and 47 deletions
-16
View File
@@ -109,21 +109,6 @@ TESTIMAGE_DUMP_DIR ?= "${LOG_DIR}/runtime-hostdump/"
TESTIMAGE_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR_IMAGE IMAGE_LINK_NAME"
testimage_dump_target () {
top -bn1
ps
free
df
# The next command will export the default gateway IP
export DEFAULT_GATEWAY=$(ip route | awk '/default/ { print $3}')
ping -c3 $DEFAULT_GATEWAY
dmesg
netstat -an
ip address
# Next command will dump logs from /var/log/
find /var/log/ -type f -name !wtmp* 2>/dev/null -exec echo "====================" \; -exec echo {} \; -exec echo "====================" \; -exec cat {} \; -exec echo "" \;
}
testimage_dump_monitor () {
query-status
query-block
@@ -352,7 +337,6 @@ def testimage_main(d):
target_kwargs['serialcontrol_cmd'] = d.getVar("TEST_SERIALCONTROL_CMD") or None
target_kwargs['serialcontrol_extra_args'] = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS") or ""
target_kwargs['testimage_dump_monitor'] = d.getVar("testimage_dump_monitor") or ""
target_kwargs['testimage_dump_target'] = d.getVar("testimage_dump_target") or ""
def export_ssh_agent(d):
import os
-10
View File
@@ -14,8 +14,6 @@ from collections import defaultdict
from .ssh import OESSHTarget
from oeqa.utils.qemurunner import QemuRunner
from oeqa.utils.dump import MonitorDumper
from oeqa.utils.dump import TargetDumper
supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
@@ -47,14 +45,6 @@ class OEQemuTarget(OESSHTarget):
use_kvm=kvm, use_slirp=slirp, dump_dir=dump_dir, logger=logger,
serial_ports=serial_ports, boot_patterns = boot_patterns,
use_ovmf=ovmf, tmpfsdir=tmpfsdir)
dump_monitor_cmds = kwargs.get("testimage_dump_monitor")
self.monitor_dumper = MonitorDumper(dump_monitor_cmds, dump_dir, self.runner)
if self.monitor_dumper:
self.monitor_dumper.create_dir("qmp")
dump_target_cmds = kwargs.get("testimage_dump_target")
self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
self.target_dumper.create_dir("qemu")
def start(self, params=None, extra_bootparams=None, runqemuparams=''):
if self.use_slirp and not self.server_ip:
+1 -19
View File
@@ -48,8 +48,6 @@ class OESSHTarget(OETarget):
if port:
self.ssh = self.ssh + [ '-p', port ]
self.scp = self.scp + [ '-P', port ]
self._monitor_dumper = None
self.target_dumper = None
def start(self, **kwargs):
pass
@@ -57,15 +55,6 @@ class OESSHTarget(OETarget):
def stop(self, **kwargs):
pass
@property
def monitor_dumper(self):
return self._monitor_dumper
@monitor_dumper.setter
def monitor_dumper(self, dumper):
self._monitor_dumper = dumper
self.monitor_dumper.dump_monitor()
def _run(self, command, timeout=None, ignore_status=True):
"""
Runs command in target using SSHProcess.
@@ -104,14 +93,7 @@ class OESSHTarget(OETarget):
status, output = self._run(sshCmd, processTimeout, ignore_status)
self.logger.debug('Command: %s\nStatus: %d Output: %s\n' % (command, status, output))
if (status == 255) and (('No route to host') in output):
if self.monitor_dumper:
self.monitor_dumper.dump_monitor()
if status == 255:
if self.target_dumper:
self.target_dumper.dump_target()
if self.monitor_dumper:
self.monitor_dumper.dump_monitor()
return (status, output)
def copyTo(self, localSrc, remoteDst):
-2
View File
@@ -103,7 +103,6 @@ class QemuTarget(BaseTarget):
self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
dump_target_cmds = d.getVar("testimage_dump_target")
dump_monitor_cmds = d.getVar("testimage_dump_monitor")
dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
if not dump_dir:
@@ -144,7 +143,6 @@ class QemuTarget(BaseTarget):
tmpfsdir = d.getVar("RUNQEMU_TMPFS_DIR"),
serial_ports = len(d.getVar("SERIAL_CONSOLES").split()))
self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
self.monitor_dumper = MonitorDumper(dump_monitor_cmds, dump_dir, self.runner)
if (self.monitor_dumper):
self.monitor_dumper.create_dir("qmp")