diff options
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 |