All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs
@ 2020-09-25 14:55 Saul Wold
  2020-09-25 14:55 ` [RFC PATCH 2/2] target/ssh.py: Add dump_target support Saul Wold
  2020-09-26 12:04 ` [OE-core] [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs Richard Purdie
  0 siblings, 2 replies; 3+ messages in thread
From: Saul Wold @ 2020-09-25 14:55 UTC (permalink / raw
  To: openembedded-core

This passes the list of commands to run on the OEQemuTarget when
the TargetDumper needs to run in a test context due to a failure
on the target.

This is added here as a kwargs because the 'd' dictionary is not
available in the staticmethod getTarget in the
OERuntimeTestContextExecutor class. The OEQemuTarget is different
from the QemuTarget which already uses the list of commands from
testimage_dump_target from 'd'. The create_dir() is needed to
initialize the TargetDumper's dump_dir variable.

Signed-off-by: Saul Wold <saul.wold@windriver.com>
---
 meta/classes/testimage.bbclass    | 1 +
 meta/lib/oeqa/core/target/qemu.py | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 00f0c29836..5a733dd8db 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -317,6 +317,7 @@ def testimage_main(d):
     target_kwargs['powercontrol_extra_args'] = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS") or ""
     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_target'] = d.getVar("testimage_dump_target") or ""
 
     def export_ssh_agent(d):
         import os
diff --git a/meta/lib/oeqa/core/target/qemu.py b/meta/lib/oeqa/core/target/qemu.py
index 295e8765e9..0f29414df5 100644
--- a/meta/lib/oeqa/core/target/qemu.py
+++ b/meta/lib/oeqa/core/target/qemu.py
@@ -12,6 +12,7 @@ from collections import defaultdict
 
 from .ssh import OESSHTarget
 from oeqa.utils.qemurunner import QemuRunner
+from oeqa.utils.dump import TargetDumper
 
 supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
 
@@ -42,6 +43,9 @@ class OEQemuTarget(OESSHTarget):
                                  dump_host_cmds=dump_host_cmds, logger=logger,
                                  serial_ports=serial_ports, boot_patterns = boot_patterns, 
                                  use_ovmf=ovmf)
+        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:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [RFC PATCH 2/2] target/ssh.py: Add dump_target support
  2020-09-25 14:55 [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs Saul Wold
@ 2020-09-25 14:55 ` Saul Wold
  2020-09-26 12:04 ` [OE-core] [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs Richard Purdie
  1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2020-09-25 14:55 UTC (permalink / raw
  To: openembedded-core

This adds the dump_target support when the ssh command fails with
a 'No route to host'. This is will provide additional data when a
Qemu target fails to respond during autobuilder testing. This does
not fix 14002 [0], but may help track down why qemu looses networking

[0] https://bugzilla.yoctoproject.org/show_bug.cgi?id=14002

Signed-off-by: Saul Wold <saul.wold@windriver.com>
---
 meta/lib/oeqa/core/target/ssh.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index aefb576805..49ce28ea34 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -88,6 +88,8 @@ class OESSHTarget(OETarget):
 
         status, output = self._run(sshCmd, processTimeout, True)
         self.logger.debug('Command: %s\nOutput:  %s\n' % (command, output))
+        if status and output in ('No route to host'):
+            self.target.target_dumper.dump_target()
         return (status, output)
 
     def copyTo(self, localSrc, remoteDst):
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs
  2020-09-25 14:55 [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs Saul Wold
  2020-09-25 14:55 ` [RFC PATCH 2/2] target/ssh.py: Add dump_target support Saul Wold
@ 2020-09-26 12:04 ` Richard Purdie
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2020-09-26 12:04 UTC (permalink / raw
  To: Saul Wold, openembedded-core

Hi Saul,

On Fri, 2020-09-25 at 07:55 -0700, Saul Wold wrote:
> This passes the list of commands to run on the OEQemuTarget when
> the TargetDumper needs to run in a test context due to a failure
> on the target.
> 
> This is added here as a kwargs because the 'd' dictionary is not
> available in the staticmethod getTarget in the
> OERuntimeTestContextExecutor class. The OEQemuTarget is different
> from the QemuTarget which already uses the list of commands from
> testimage_dump_target from 'd'. The create_dir() is needed to
> initialize the TargetDumper's dump_dir variable.
> 
> Signed-off-by: Saul Wold <saul.wold@windriver.com>
> ---
>  meta/classes/testimage.bbclass    | 1 +
>  meta/lib/oeqa/core/target/qemu.py | 4 ++++
>  2 files changed, 5 insertions(+)

Thanks for looking at this, I'm really keen to get something in place
to help with this. Unfortunately testing showed up test failures, I'm
not sure why at this point:

https://autobuilder.yoctoproject.org/typhoon/#/builders/47/builds/2520/steps/8/logs/step1c
https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/2508

basically I think all the failures appearing in:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/1422

are coming from this unfortunately (although there could be some from
other changes under test).

Cheers,

Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-26 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-25 14:55 [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs Saul Wold
2020-09-25 14:55 ` [RFC PATCH 2/2] target/ssh.py: Add dump_target support Saul Wold
2020-09-26 12:04 ` [OE-core] [RFC PATCH 1/2] testimage: Add testimage_dump_target to kwargs Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.