summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-09-22 11:14:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-24 17:54:28 +0100
commit68073270f8674104774bee90cf54945a3f6224a8 (patch)
tree85c224d2599ba4684dd2524b29d619d37334be48 /meta/lib/oeqa/utils
parent5d31e9400d2d4777a9dc2fa0e62eeb368103b3cb (diff)
downloadpoky-68073270f8674104774bee90cf54945a3f6224a8.tar.gz
oeqa/utils/dump: Add default commands and directory
Currently if qemu fails when running a selftest and tries to run some commands on the host it will fail because some variables required by the Dumper class do not exist because testimage was not included. This change adds a default parent directory to save the dumps for the host or target. Also adds default commands to run if no commands were provided to the class. With these changes the previous errors using selftest don't show anymore. [YOCTO #8306] (From OE-Core rev: 713beaf84f8b8ab415b7a8ccba8a4a2aff7f98e5) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/dump.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/dump.py b/meta/lib/oeqa/utils/dump.py
index 4ae871c657..3f31e206a5 100644
--- a/meta/lib/oeqa/utils/dump.py
+++ b/meta/lib/oeqa/utils/dump.py
@@ -16,9 +16,18 @@ class BaseDumper(object):
16 16
17 def __init__(self, cmds, parent_dir): 17 def __init__(self, cmds, parent_dir):
18 self.cmds = [] 18 self.cmds = []
19 self.parent_dir = parent_dir 19 # Some testing doesn't inherit testimage, so it is needed
20 # to set some defaults.
21 self.parent_dir = parent_dir or "/tmp/oe-saved-tests"
22 dft_cmds = """ top -bn1
23 ps -ef
24 free
25 df
26 memstat
27 dmesg
28 netstat -an"""
20 if not cmds: 29 if not cmds:
21 return 30 cmds = dft_cmds
22 for cmd in cmds.split('\n'): 31 for cmd in cmds.split('\n'):
23 cmd = cmd.lstrip() 32 cmd = cmd.lstrip()
24 if not cmd or cmd[0] == '#': 33 if not cmd or cmd[0] == '#':