All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Create target sdk manifest file and use it for automated sdk testing
@ 2014-08-26 10:05 Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 1/4] classes/populate_sdk_base.bbclass: add a manifest for target sdk Corneliu Stoicescu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Corneliu Stoicescu @ 2014-08-26 10:05 UTC (permalink / raw)
  To: openembedded-core

In order to automatically determine what packages are present in the target sdk, we needed a target sdk manifest file, similar to the one created for machine images rootfs. 
Also, in order to enable the testsdk task to skip modules, some changes and additions had to be made.

Corneliu Stoicescu (4):
  classes/populate_sdk_base.bbclass: add a manifest for target sdk
  classes/testimage.bbclass: add more fields to the sdk TestContext
  oeqa/oetest.py: enable sdk tests to use hasFeature and hasPackage
    methods.
  oeqa/sdk/buildsudoku.py: add setUpModule method to run only when gtk+
    in installed.

 meta/classes/populate_sdk_base.bbclass | 12 ++++++++++++
 meta/classes/testimage.bbclass         |  8 ++++++++
 meta/lib/oeqa/oetest.py                |  4 ++--
 meta/lib/oeqa/sdk/buildsudoku.py       |  4 ++++
 4 files changed, 26 insertions(+), 2 deletions(-)

-- 
1.8.3.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] classes/populate_sdk_base.bbclass: add a manifest for target sdk
  2014-08-26 10:05 [PATCH 0/4] Create target sdk manifest file and use it for automated sdk testing Corneliu Stoicescu
@ 2014-08-26 10:05 ` Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 2/4] classes/testimage.bbclass: add more fields to the sdk TestContext Corneliu Stoicescu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Corneliu Stoicescu @ 2014-08-26 10:05 UTC (permalink / raw)
  To: openembedded-core

Similar to the way BSP images have rootfs a manifest, the toolchain now also has a manifest file created alongside the sdk image.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 meta/classes/populate_sdk_base.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 9e3bd61..db64d3a 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -52,6 +52,18 @@ EXCLUDE_FROM_WORLD = "1"
 
 SDK_PACKAGING_FUNC ?= "create_shar"
 
+SDK_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.manifest"
+python write_target_sdk_manifest () {
+    from oe.sdk import sdk_list_installed_packages
+    sdkmanifestdir = os.path.dirname(d.getVar("SDK_MANIFEST", True))
+    if not os.path.exists(sdkmanifestdir):
+        bb.utils.mkdirhier(sdkmanifestdir)
+    with open(d.getVar('SDK_MANIFEST', True), 'w') as output:
+        output.write(sdk_list_installed_packages(d, True, 'ver'))
+}
+
+POPULATE_SDK_POST_TARGET_COMMAND_append = " write_target_sdk_manifest ; "
+
 fakeroot python do_populate_sdk() {
     from oe.sdk import populate_sdk
     from oe.manifest import create_manifest, Manifest
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] classes/testimage.bbclass: add more fields to the sdk TestContext
  2014-08-26 10:05 [PATCH 0/4] Create target sdk manifest file and use it for automated sdk testing Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 1/4] classes/populate_sdk_base.bbclass: add a manifest for target sdk Corneliu Stoicescu
@ 2014-08-26 10:05 ` Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 3/4] oeqa/oetest.py: enable sdk tests to use hasFeature and hasPackage methods Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 4/4] oeqa/sdk/buildsudoku.py: add setUpModule method to run only when gtk+ in installed Corneliu Stoicescu
  3 siblings, 0 replies; 5+ messages in thread
From: Corneliu Stoicescu @ 2014-08-26 10:05 UTC (permalink / raw)
  To: openembedded-core

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(+)

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()
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] oeqa/oetest.py: enable sdk tests to use hasFeature and hasPackage methods.
  2014-08-26 10:05 [PATCH 0/4] Create target sdk manifest file and use it for automated sdk testing Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 1/4] classes/populate_sdk_base.bbclass: add a manifest for target sdk Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 2/4] classes/testimage.bbclass: add more fields to the sdk TestContext Corneliu Stoicescu
@ 2014-08-26 10:05 ` Corneliu Stoicescu
  2014-08-26 10:05 ` [PATCH 4/4] oeqa/sdk/buildsudoku.py: add setUpModule method to run only when gtk+ in installed Corneliu Stoicescu
  3 siblings, 0 replies; 5+ messages in thread
From: Corneliu Stoicescu @ 2014-08-26 10:05 UTC (permalink / raw)
  To: openembedded-core

In order to use the hasFeature and hasPackage methods, we need to make oeSDKTest extend oeTest and also set the test context (tc) attribute in the oeTest class when loading the tests.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 meta/lib/oeqa/oetest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 5552c43..ed8b3b2 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -23,7 +23,7 @@ def loadTests(tc, type="runtime"):
         suite = unittest.TestSuite()
     elif type == "sdk":
         # set the context object passed from the test class
-        setattr(oeSDKTest, "tc", tc)
+        setattr(oeTest, "tc", tc)
     testloader = unittest.TestLoader()
     testloader.sortTestMethodsUsing = None
     suite = testloader.loadTestsFromNames(tc.testslist)
@@ -66,7 +66,7 @@ class oeRuntimeTest(oeTest):
         self.target = oeRuntimeTest.tc.target
         super(oeRuntimeTest, self).__init__(methodName)
 
-class oeSDKTest(unittest.TestCase):
+class oeSDKTest(oeTest):
     def __init__(self, methodName='runTest'):
         self.sdktestdir = oeSDKTest.tc.sdktestdir
         super(oeSDKTest, self).__init__(methodName)
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] oeqa/sdk/buildsudoku.py: add setUpModule method to run only when gtk+ in installed.
  2014-08-26 10:05 [PATCH 0/4] Create target sdk manifest file and use it for automated sdk testing Corneliu Stoicescu
                   ` (2 preceding siblings ...)
  2014-08-26 10:05 ` [PATCH 3/4] oeqa/oetest.py: enable sdk tests to use hasFeature and hasPackage methods Corneliu Stoicescu
@ 2014-08-26 10:05 ` Corneliu Stoicescu
  3 siblings, 0 replies; 5+ messages in thread
From: Corneliu Stoicescu @ 2014-08-26 10:05 UTC (permalink / raw)
  To: openembedded-core

Adding setUpModule in order to skip the module when gtk+ is not installed in the toolchain.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 meta/lib/oeqa/sdk/buildsudoku.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oeqa/sdk/buildsudoku.py b/meta/lib/oeqa/sdk/buildsudoku.py
index 6a60c76..dea77c6 100644
--- a/meta/lib/oeqa/sdk/buildsudoku.py
+++ b/meta/lib/oeqa/sdk/buildsudoku.py
@@ -2,6 +2,10 @@ from oeqa.oetest import oeSDKTest, skipModule
 from oeqa.utils.decorators import *
 from oeqa.utils.targetbuild import SDKBuildProject
 
+def setUpModule():
+    if not oeSDKTest.hasPackage("gtk\+"):
+        skipModule("Image doesn't have gtk+ in manifest")
+
 class SudokuTest(oeSDKTest):
 
     @classmethod
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-26  8:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26 10:05 [PATCH 0/4] Create target sdk manifest file and use it for automated sdk testing Corneliu Stoicescu
2014-08-26 10:05 ` [PATCH 1/4] classes/populate_sdk_base.bbclass: add a manifest for target sdk Corneliu Stoicescu
2014-08-26 10:05 ` [PATCH 2/4] classes/testimage.bbclass: add more fields to the sdk TestContext Corneliu Stoicescu
2014-08-26 10:05 ` [PATCH 3/4] oeqa/oetest.py: enable sdk tests to use hasFeature and hasPackage methods Corneliu Stoicescu
2014-08-26 10:05 ` [PATCH 4/4] oeqa/sdk/buildsudoku.py: add setUpModule method to run only when gtk+ in installed Corneliu Stoicescu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.