Patchwork [2/4] classes/testimage.bbclass: add more fields to the sdk TestContext

login
register
mail settings
Submitter Corneliu Stoicescu
Date Aug. 26, 2014, 10:05 a.m.
Message ID <1409047544-7026-3-git-send-email-corneliux.stoicescu@intel.com>
Download mbox | patch
Permalink /patch/78961/
State Accepted
Commit e04172d8bd5bcaf0de9768d8ba044f627b2d02b0
Headers show

Comments

Corneliu Stoicescu - Aug. 26, 2014, 10:05 a.m.
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>
---
 meta/classes/testimage.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 97d0380..f2480fe 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -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()