From 731acba417b627f6d3ef7e856cbe36491aa70d22 Mon Sep 17 00:00:00 2001 From: Stefan Stanacar Date: Mon, 3 Feb 2014 21:22:29 +0200 Subject: 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 Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/lib/oeqa/oetest.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'meta/lib/oeqa/oetest.py') 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 @@ 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 -- cgit v1.2.3-54-g00ecf