]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
classes/testimage.bbclass: add more fields to the sdk TestContext
authorCorneliu Stoicescu <corneliux.stoicescu@intel.com>
Tue, 26 Aug 2014 10:05:42 +0000 (13:05 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 27 Aug 2014 11:12:06 +0000 (12:12 +0100)
In order to use hasFeature and hasPackage methods in sdk test modules, we need specific fields to be set in the TestContext object.
Adding pkgmanifest, imagefeatures and distrofeatures to the TestContext.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testimage.bbclass

index 97d0380153a084ebfde50013bdd579b604a2a304..f2480fe085b71dd5375d86fa4c835f90acbda865 100644 (file)
@@ -281,6 +281,14 @@ def testsdk_main(d):
             self.filesdir = os.path.join(os.path.dirname(os.path.abspath(oeqa.runtime.__file__)),"files")
             self.sdktestdir = sdktestdir
             self.sdkenv = sdkenv
+            self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split()
+            self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split()
+            manifest = os.path.join(d.getVar("SDK_MANIFEST", True))
+            try:
+                with open(manifest) as f:
+                    self.pkgmanifest = f.read()
+            except IOError as e:
+                bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
 
     # test context
     tc = TestContext()