summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/oetest.py6
-rwxr-xr-xmeta/lib/oeqa/runexported.py19
-rw-r--r--meta/lib/oeqa/utils/commands.py6
3 files changed, 20 insertions, 11 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index fc1e8b514d..8eb84ed65d 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -19,7 +19,11 @@ except ImportError:
19import logging 19import logging
20 20
21import oeqa.runtime 21import oeqa.runtime
22import oeqa.sdkext 22# Exported test doesn't require sdkext
23try:
24 import oeqa.sdkext
25except ImportError:
26 pass
23from oeqa.utils.decorators import LogResults, gettag, getResults 27from oeqa.utils.decorators import LogResults, gettag, getResults
24from oeqa.utils import avoid_paths_in_environ 28from oeqa.utils import avoid_paths_in_environ
25 29
diff --git a/meta/lib/oeqa/runexported.py b/meta/lib/oeqa/runexported.py
index e9a29126c8..cc89e13c06 100755
--- a/meta/lib/oeqa/runexported.py
+++ b/meta/lib/oeqa/runexported.py
@@ -30,7 +30,7 @@ except ImportError:
30 30
31sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) 31sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa")))
32 32
33from oeqa.oetest import runTests 33from oeqa.oetest import TestContext
34from oeqa.utils.sshcontrol import SSHControl 34from oeqa.utils.sshcontrol import SSHControl
35from oeqa.utils.dump import get_host_dumper 35from oeqa.utils.dump import get_host_dumper
36 36
@@ -49,7 +49,7 @@ class FakeTarget(object):
49 def exportStart(self): 49 def exportStart(self):
50 self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime) 50 self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
51 sshloglink = os.path.join(self.testdir, "ssh_target_log") 51 sshloglink = os.path.join(self.testdir, "ssh_target_log")
52 if os.path.exists(sshloglink): 52 if os.path.lexists(sshloglink):
53 os.remove(sshloglink) 53 os.remove(sshloglink)
54 os.symlink(self.sshlog, sshloglink) 54 os.symlink(self.sshlog, sshloglink)
55 print("SSH log file: %s" % self.sshlog) 55 print("SSH log file: %s" % self.sshlog)
@@ -69,10 +69,9 @@ class MyDataDict(dict):
69 def getVar(self, key, unused = None): 69 def getVar(self, key, unused = None):
70 return self.get(key, "") 70 return self.get(key, "")
71 71
72class TestContext(object): 72class ExportTestContext(TestContext):
73 def __init__(self): 73 def __init__(self, d):
74 self.d = None 74 self.d = d
75 self.target = None
76 75
77def main(): 76def main():
78 77
@@ -121,7 +120,9 @@ def main():
121 host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"] 120 host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"]
122 host_dumper.cmds = loaded["host_dumper"]["cmds"] 121 host_dumper.cmds = loaded["host_dumper"]["cmds"]
123 122
124 tc = TestContext() 123 target.exportStart()
124 tc = ExportTestContext(d)
125
125 setattr(tc, "d", d) 126 setattr(tc, "d", d)
126 setattr(tc, "target", target) 127 setattr(tc, "target", target)
127 setattr(tc, "host_dumper", host_dumper) 128 setattr(tc, "host_dumper", host_dumper)
@@ -129,8 +130,8 @@ def main():
129 if key != "d" and key != "target" and key != "host_dumper": 130 if key != "d" and key != "target" and key != "host_dumper":
130 setattr(tc, key, loaded[key]) 131 setattr(tc, key, loaded[key])
131 132
132 target.exportStart() 133 tc.loadTests()
133 runTests(tc) 134 tc.runTests()
134 135
135 return 0 136 return 0
136 137
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 32e001c6b5..48f6441290 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -18,7 +18,11 @@ from oeqa.utils import CommandError
18from oeqa.utils import ftools 18from oeqa.utils import ftools
19import re 19import re
20import contextlib 20import contextlib
21import bb 21# Export test doesn't require bb
22try:
23 import bb
24except ImportError:
25 pass
22 26
23class Command(object): 27class Command(object):
24 def __init__(self, command, bg=False, timeout=None, data=None, **options): 28 def __init__(self, command, bg=False, timeout=None, data=None, **options):