]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/utils/dump: Add default commands and directory
authorMariano Lopez <mariano.lopez@linux.intel.com>
Tue, 22 Sep 2015 11:14:15 +0000 (11:14 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Sep 2015 21:21:02 +0000 (22:21 +0100)
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>
meta/lib/oeqa/utils/dump.py

index 4ae871c65773908e5c1b9dd2bc481a4cb8866143..3f31e206a584b859186abcbd2dc2b4b6c7ab3436 100644 (file)
@@ -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] == '#':