Skip to contentSkip to conversation

oeqa/utils/dump: Add default commands and directory

PATCH New [email protected] 1 participant 1 message Sep 22, 2015 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 oeqa/utils/dump: Add default commands and directory

In reply to a message not in the archive

From: Mariano Lopez <[email protected]>

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]

---
 meta/lib/oeqa/utils/dump.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta/lib/oeqa/utils/dump.py +11 -2
index 4ae871c..3f31e20 100644
@@ -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] == '#':
Signature · 1 line
1.8.4.5