summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/testimage.bbclass6
-rw-r--r--meta/lib/oeqa/oetest.py3
-rwxr-xr-xmeta/lib/oeqa/runexported.py8
3 files changed, 13 insertions, 4 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 82cb0110e3..8fa00f5fbf 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -173,9 +173,10 @@ def exportTests(d,tc):
173 savedata = {} 173 savedata = {}
174 savedata["d"] = {} 174 savedata["d"] = {}
175 savedata["target"] = {} 175 savedata["target"] = {}
176 savedata["host_dumper"] = {}
176 for key in tc.__dict__: 177 for key in tc.__dict__:
177 # special cases 178 # special cases
178 if key != "d" and key != "target": 179 if key != "d" and key != "target" and key != "host_dumper":
179 savedata[key] = getattr(tc, key) 180 savedata[key] = getattr(tc, key)
180 savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP", True) 181 savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP", True)
181 savedata["target"]["server_ip"] = tc.target.server_ip or d.getVar("TEST_SERVER_IP", True) 182 savedata["target"]["server_ip"] = tc.target.server_ip or d.getVar("TEST_SERVER_IP", True)
@@ -189,6 +190,9 @@ def exportTests(d,tc):
189 # we don't care about those anyway 190 # we don't care about those anyway
190 pass 191 pass
191 192
193 savedata["host_dumper"]["parent_dir"] = tc.host_dumper.parent_dir
194 savedata["host_dumper"]["cmds"] = tc.host_dumper.cmds
195
192 with open(os.path.join(exportpath, "testdata.json"), "w") as f: 196 with open(os.path.join(exportpath, "testdata.json"), "w") as f:
193 json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True) 197 json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True)
194 198
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 4224206546..4773bdd4d8 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -13,7 +13,6 @@ import inspect
13import subprocess 13import subprocess
14import bb 14import bb
15from oeqa.utils.decorators import LogResults 15from oeqa.utils.decorators import LogResults
16from oeqa.targetcontrol import QemuTarget
17from sys import exc_info, exc_clear 16from sys import exc_info, exc_clear
18 17
19def loadTests(tc, type="runtime"): 18def loadTests(tc, type="runtime"):
@@ -124,7 +123,7 @@ class oeRuntimeTest(oeTest):
124 if not exc_info() == (None, None, None): 123 if not exc_info() == (None, None, None):
125 exc_clear() 124 exc_clear()
126 #Only dump for QemuTarget 125 #Only dump for QemuTarget
127 if (isinstance(self.target, QemuTarget)): 126 if (type(self.target).__name__ == "QemuTarget"):
128 self.tc.host_dumper.create_dir(self._testMethodName) 127 self.tc.host_dumper.create_dir(self._testMethodName)
129 self.tc.host_dumper.dump_host() 128 self.tc.host_dumper.dump_host()
130 self.target.target_dumper.dump_target( 129 self.target.target_dumper.dump_target(
diff --git a/meta/lib/oeqa/runexported.py b/meta/lib/oeqa/runexported.py
index e1b6642ec2..96442b1b27 100755
--- a/meta/lib/oeqa/runexported.py
+++ b/meta/lib/oeqa/runexported.py
@@ -32,6 +32,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))
32 32
33from oeqa.oetest import runTests 33from oeqa.oetest import runTests
34from oeqa.utils.sshcontrol import SSHControl 34from oeqa.utils.sshcontrol import SSHControl
35from oeqa.utils.dump import get_host_dumper
35 36
36# this isn't pretty but we need a fake target object 37# this isn't pretty but we need a fake target object
37# for running the tests externally as we don't care 38# for running the tests externally as we don't care
@@ -118,11 +119,16 @@ def main():
118 for key in loaded["target"].keys(): 119 for key in loaded["target"].keys():
119 setattr(target, key, loaded["target"][key]) 120 setattr(target, key, loaded["target"][key])
120 121
122 host_dumper = get_host_dumper(d)
123 host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"]
124 host_dumper.cmds = loaded["host_dumper"]["cmds"]
125
121 tc = TestContext() 126 tc = TestContext()
122 setattr(tc, "d", d) 127 setattr(tc, "d", d)
123 setattr(tc, "target", target) 128 setattr(tc, "target", target)
129 setattr(tc, "host_dumper", host_dumper)
124 for key in loaded.keys(): 130 for key in loaded.keys():
125 if key != "d" and key != "target": 131 if key != "d" and key != "target" and key != "host_dumper":
126 setattr(tc, key, loaded[key]) 132 setattr(tc, key, loaded[key])
127 133
128 target.exportStart() 134 target.exportStart()