mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
da1331b4ce
commit
731acba417
+6
-11
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user