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-08 21:00:31 +0000 |
commit | 155dd52e0f707e06f50756584a50f744ba6b7844 (patch) | |
tree | 8e45c3e8c784bd493801c7ee29dd5ec03c54f959 /meta/lib/oeqa/oetest.py | |
parent | de9b693f4ff311f1310a1c6005e0d5c225aabef6 (diff) | |
download | openembedded-core-contrib-155dd52e0f707e06f50756584a50f744ba6b7844.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]
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
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 23a3e5d69f5..0db6cb80a90 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py @@ -10,8 +10,6 @@ import os, re, mmap import unittest import inspect -import bb -from oeqa.utils.sshcontrol import SSHControl def loadTests(tc): @@ -31,15 +29,14 @@ def loadTests(tc): def runTests(tc): suite = loadTests(tc) - bb.note("Test modules %s" % tc.testslist) - bb.note("Found %s tests" % suite.countTestCases()) + print("Test modules %s" % tc.testslist) + print("Found %s tests" % suite.countTestCases()) runner = unittest.TextTestRunner(verbosity=2) result = runner.run(suite) return result - class oeTest(unittest.TestCase): longMessage = True @@ -60,18 +57,16 @@ class oeTest(unittest.TestCase): @classmethod def hasPackage(self, pkg): - manifest = os.path.join(oeTest.tc.d.getVar("DEPLOY_DIR_IMAGE", True), oeTest.tc.d.getVar("IMAGE_LINK_NAME", True) + ".manifest") - with open(manifest) as f: - data = f.read() - if re.search(pkg, data): + + if re.search(pkg, oeTest.tc.pkgmanifest): return True return False @classmethod def hasFeature(self,feature): - if feature in oeTest.tc.d.getVar("IMAGE_FEATURES", True).split() or \ - feature in oeTest.tc.d.getVar("DISTRO_FEATURES", True).split(): + if feature in oeTest.tc.imagefeatures or \ + feature in oeTest.tc.distrofeatures: return True else: return False |