summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-rw-r--r--meta/lib/oeqa/oetest.py28
1 files changed, 21 insertions, 7 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 3ed5bb8..9ef4d1f 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -58,14 +58,24 @@ class oeTest(unittest.TestCase):
58 58
59 @classmethod 59 @classmethod
60 def hasPackage(self, pkg): 60 def hasPackage(self, pkg):
61 for item in oeTest.tc.pkgmanifest.split('\n'): 61 """
62 if re.match(pkg, item): 62 True if the full package name exists in the manifest, False otherwise.
63 """
64 return pkg in oeTest.tc.pkgmanifest
65
66 @classmethod
67 def hasPackageMatch(self, match):
68 """
69 True if match exists in the manifest as a regular expression substring,
70 False otherwise.
71 """
72 for s in oeTest.tc.pkgmanifest:
73 if re.match(match, s):
63 return True 74 return True
64 return False 75 return False
65 76
66 @classmethod 77 @classmethod
67 def hasFeature(self,feature): 78 def hasFeature(self,feature):
68
69 if feature in oeTest.tc.imagefeatures or \ 79 if feature in oeTest.tc.imagefeatures or \
70 feature in oeTest.tc.distrofeatures: 80 feature in oeTest.tc.distrofeatures:
71 return True 81 return True
@@ -340,17 +350,18 @@ class ImageTestContext(TestContext):
340 self.target = target 350 self.target = target
341 self.host_dumper = host_dumper 351 self.host_dumper = host_dumper
342 352
353 self.pkgmanifest = {}
343 manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), 354 manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),
344 d.getVar("IMAGE_LINK_NAME", True) + ".manifest") 355 d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
345 nomanifest = d.getVar("IMAGE_NO_MANIFEST", True) 356 nomanifest = d.getVar("IMAGE_NO_MANIFEST", True)
346 if nomanifest is None or nomanifest != "1": 357 if nomanifest is None or nomanifest != "1":
347 try: 358 try:
348 with open(manifest) as f: 359 with open(manifest) as f:
349 self.pkgmanifest = f.read() 360 for line in f:
361 (pkg, arch, version) = line.strip().split()
362 self.pkgmanifest[pkg] = (version, arch)
350 except IOError as e: 363 except IOError as e:
351 bb.fatal("No package manifest file found. Did you build the image?\n%s" % e) 364 bb.fatal("No package manifest file found. Did you build the image?\n%s" % e)
352 else:
353 self.pkgmanifest = ""
354 365
355 self.sigterm = False 366 self.sigterm = False
356 self.origsigtermhandler = signal.getsignal(signal.SIGTERM) 367 self.origsigtermhandler = signal.getsignal(signal.SIGTERM)
@@ -396,8 +407,11 @@ class SDKTestContext(TestContext):
396 if not hasattr(self, 'target_manifest'): 407 if not hasattr(self, 'target_manifest'):
397 self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True) 408 self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True)
398 try: 409 try:
410 self.pkgmanifest = {}
399 with open(self.target_manifest) as f: 411 with open(self.target_manifest) as f:
400 self.pkgmanifest = f.read() 412 for line in f:
413 (pkg, arch, version) = line.strip().split()
414 self.pkgmanifest[pkg] = (version, arch)
401 except IOError as e: 415 except IOError as e:
402 bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) 416 bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
403 417