diff options
author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2014-02-03 21:22:29 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-09 09:40:00 +0000 |
commit | 731acba417b627f6d3ef7e856cbe36491aa70d22 (patch) | |
tree | 3078a3b52f1bb357e7961d86a0184dcb92d28896 /meta/lib/oeqa/oetest.py | |
parent | da1331b4ceca1729fa33818b89a2203ea8301103 (diff) | |
download | poky-731acba417b627f6d3ef7e856cbe36491aa70d22.tar.gz |
testimage: add ability to export tests
Add the ability to export the tests so that they can run independently of
the build system, as is required if you want to be able to hand the test
execution off to a scheduler.
Booting/deployment of the target is still handled by the build system,
as before, only the execution of the tests happens outside of the build system.
Tests exported are the ones defined in TEST_SUITES.
No tests have been changed as interesting parts of the data store have been
exported and tests can continue to query them as before. Small adjustments were made
for a couple of oeqa modules though.
[YOCTO #5613]
(From OE-Core rev: 155dd52e0f707e06f50756584a50f744ba6b7844)
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-rw-r--r-- | meta/lib/oeqa/oetest.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py index 23a3e5d69f..0db6cb80a9 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py | |||
@@ -10,8 +10,6 @@ | |||
10 | import os, re, mmap | 10 | import os, re, mmap |
11 | import unittest | 11 | import unittest |
12 | import inspect | 12 | import inspect |
13 | import bb | ||
14 | from oeqa.utils.sshcontrol import SSHControl | ||
15 | 13 | ||
16 | 14 | ||
17 | def loadTests(tc): | 15 | def loadTests(tc): |
@@ -31,15 +29,14 @@ def loadTests(tc): | |||
31 | def runTests(tc): | 29 | def runTests(tc): |
32 | 30 | ||
33 | suite = loadTests(tc) | 31 | suite = loadTests(tc) |
34 | bb.note("Test modules %s" % tc.testslist) | 32 | print("Test modules %s" % tc.testslist) |
35 | bb.note("Found %s tests" % suite.countTestCases()) | 33 | print("Found %s tests" % suite.countTestCases()) |
36 | runner = unittest.TextTestRunner(verbosity=2) | 34 | runner = unittest.TextTestRunner(verbosity=2) |
37 | result = runner.run(suite) | 35 | result = runner.run(suite) |
38 | 36 | ||
39 | return result | 37 | return result |
40 | 38 | ||
41 | 39 | ||
42 | |||
43 | class oeTest(unittest.TestCase): | 40 | class oeTest(unittest.TestCase): |
44 | 41 | ||
45 | longMessage = True | 42 | longMessage = True |
@@ -60,18 +57,16 @@ class oeTest(unittest.TestCase): | |||
60 | 57 | ||
61 | @classmethod | 58 | @classmethod |
62 | def hasPackage(self, pkg): | 59 | def hasPackage(self, pkg): |
63 | manifest = os.path.join(oeTest.tc.d.getVar("DEPLOY_DIR_IMAGE", True), oeTest.tc.d.getVar("IMAGE_LINK_NAME", True) + ".manifest") | 60 | |
64 | with open(manifest) as f: | 61 | if re.search(pkg, oeTest.tc.pkgmanifest): |
65 | data = f.read() | ||
66 | if re.search(pkg, data): | ||
67 | return True | 62 | return True |
68 | return False | 63 | return False |
69 | 64 | ||
70 | @classmethod | 65 | @classmethod |
71 | def hasFeature(self,feature): | 66 | def hasFeature(self,feature): |
72 | 67 | ||
73 | if feature in oeTest.tc.d.getVar("IMAGE_FEATURES", True).split() or \ | 68 | if feature in oeTest.tc.imagefeatures or \ |
74 | feature in oeTest.tc.d.getVar("DISTRO_FEATURES", True).split(): | 69 | feature in oeTest.tc.distrofeatures: |
75 | return True | 70 | return True |
76 | else: | 71 | else: |
77 | return False | 72 | return False |