summaryrefslogtreecommitdiff
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-23 22:21:02 +0100
commit713beaf84f8b8ab415b7a8ccba8a4a2aff7f98e5 (patch)
treef9e8db5a2acea5788fb62cb96b368ab1e1740695
parenta2123dd753b70470065df277deda500cae478289 (diff)
downloadopenembedded-core-713beaf84f8b8ab415b7a8ccba8a4a2aff7f98e5.tar.gz
openembedded-core-713beaf84f8b8ab415b7a8ccba8a4a2aff7f98e5.tar.bz2
openembedded-core-713beaf84f8b8ab415b7a8ccba8a4a2aff7f98e5.zip
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
def __init__(self, cmds, parent_dir):
self.cmds = []
- self.parent_dir = parent_dir
+ # Some testing doesn't inherit testimage, so it is needed
+ # to set some defaults.
+ self.parent_dir = parent_dir or "/tmp/oe-saved-tests"
+ dft_cmds = """ top -bn1
+ ps -ef
+ free
+ df
+ memstat
+ dmesg
+ netstat -an"""
if not cmds:
- return
+ cmds = dft_cmds
for cmd in cmds.split('\n'):
cmd = cmd.lstrip()
if not cmd or cmd[0] == '#':