summaryrefslogtreecommitdiffstats
path: root/meta/classes/testimage.bbclass
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-09-01 07:36:30 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-03 12:43:17 +0100
commita2b0d0423555e9b386f1a7bb620837c23be3854e (patch)
tree813298c5de3b509b12ac03e3222744305da458ca /meta/classes/testimage.bbclass
parent53ab41a5f6d20e911362a9261ae528452bb71bbd (diff)
downloadpoky-a2b0d0423555e9b386f1a7bb620837c23be3854e.tar.gz
runexported: Make it compatible with host dump
Currently it is not possible to run a exported test, but this patch will allow to use the HosDumper class when running a exported test, otherwise the HostDumper class will break runexpored test. [YOCTO #8118] (From OE-Core rev: 25814dbdd12db0499e4d81876873158e1b8a4fcc) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r--meta/classes/testimage.bbclass6
1 files changed, 5 insertions, 1 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