diff options
| -rw-r--r-- | meta/lib/oeqa/oetest.py | 6 | ||||
| -rwxr-xr-x | meta/lib/oeqa/runexported.py | 19 | ||||
| -rw-r--r-- | meta/lib/oeqa/utils/commands.py | 6 |
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: | |||
| 19 | import logging | 19 | import logging |
| 20 | 20 | ||
| 21 | import oeqa.runtime | 21 | import oeqa.runtime |
| 22 | import oeqa.sdkext | 22 | # Exported test doesn't require sdkext |
| 23 | try: | ||
| 24 | import oeqa.sdkext | ||
| 25 | except ImportError: | ||
| 26 | pass | ||
| 23 | from oeqa.utils.decorators import LogResults, gettag, getResults | 27 | from oeqa.utils.decorators import LogResults, gettag, getResults |
| 24 | from oeqa.utils import avoid_paths_in_environ | 28 | from 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 | ||
| 31 | sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) | 31 | sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) |
| 32 | 32 | ||
| 33 | from oeqa.oetest import runTests | 33 | from oeqa.oetest import TestContext |
| 34 | from oeqa.utils.sshcontrol import SSHControl | 34 | from oeqa.utils.sshcontrol import SSHControl |
| 35 | from oeqa.utils.dump import get_host_dumper | 35 | from 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 | ||
| 72 | class TestContext(object): | 72 | class 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 | ||
| 77 | def main(): | 76 | def 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 | |||
| 18 | from oeqa.utils import ftools | 18 | from oeqa.utils import ftools |
| 19 | import re | 19 | import re |
| 20 | import contextlib | 20 | import contextlib |
| 21 | import bb | 21 | # Export test doesn't require bb |
| 22 | try: | ||
| 23 | import bb | ||
| 24 | except ImportError: | ||
| 25 | pass | ||
| 22 | 26 | ||
| 23 | class Command(object): | 27 | class 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): |
