From 25814dbdd12db0499e4d81876873158e1b8a4fcc Mon Sep 17 00:00:00 2001 From: Mariano Lopez Date: Tue, 1 Sep 2015 07:36:30 +0000 Subject: 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] Signed-off-by: Mariano Lopez Signed-off-by: Richard Purdie --- meta/lib/oeqa/oetest.py | 3 +-- meta/lib/oeqa/runexported.py | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'meta/lib') 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 import subprocess import bb from oeqa.utils.decorators import LogResults -from oeqa.targetcontrol import QemuTarget from sys import exc_info, exc_clear def loadTests(tc, type="runtime"): @@ -124,7 +123,7 @@ class oeRuntimeTest(oeTest): if not exc_info() == (None, None, None): exc_clear() #Only dump for QemuTarget - if (isinstance(self.target, QemuTarget)): + if (type(self.target).__name__ == "QemuTarget"): self.tc.host_dumper.create_dir(self._testMethodName) self.tc.host_dumper.dump_host() 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")) from oeqa.oetest import runTests from oeqa.utils.sshcontrol import SSHControl +from oeqa.utils.dump import get_host_dumper # this isn't pretty but we need a fake target object # for running the tests externally as we don't care @@ -118,11 +119,16 @@ def main(): for key in loaded["target"].keys(): setattr(target, key, loaded["target"][key]) + host_dumper = get_host_dumper(d) + host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"] + host_dumper.cmds = loaded["host_dumper"]["cmds"] + tc = TestContext() setattr(tc, "d", d) setattr(tc, "target", target) + setattr(tc, "host_dumper", host_dumper) for key in loaded.keys(): - if key != "d" and key != "target": + if key != "d" and key != "target" and key != "host_dumper": setattr(tc, key, loaded[key]) target.exportStart() -- cgit 1.2.3-korg