[oe-commits] Ed Bartosh : oe-selftest: wic: configure a build

git at git.openembedded.org git at git.openembedded.org
Wed Sep 2 22:54:21 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: c5bb95704e00e7afdbcb2e02c1fbc74f33e26481
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c5bb95704e00e7afdbcb2e02c1fbc74f33e26481

Author: Ed Bartosh <ed.bartosh at linux.intel.com>
Date:   Wed Sep  2 13:58:03 2015 +0300

oe-selftest: wic: configure a build

Added MACHINE_FEATURES and IMAGE_FSTYPES variables to the build config
to ensure that bootimg and efi artifacts are built. This is needed to
build canned wic images that are using those artifacts.

Introduced class variable Wic.image_is_ready to avoid building image
more than once. It would be better to build image in setUpClass, which
is called only once, but add_config method can't be called in class method,
so we have to use this trick with class variable in setUp method.

Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oeqa/selftest/wic.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index 6bc4b60..817a820 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -39,12 +39,21 @@ class Wic(oeSelfTest):
 
     @classmethod
     def setUpClass(cls):
-        """Build wic runtime dependencies and images used in the tests."""
+        """Build wic runtime dependencies."""
         bitbake('syslinux syslinux-native parted-native gptfdisk-native '
-                'dosfstools-native mtools-native core-image-minimal')
+                'dosfstools-native mtools-native')
+        Wic.image_is_ready = False
 
     def setUp(self):
         """This code is executed before each test method."""
+        if not Wic.image_is_ready:
+            # build core-image-minimal with required features
+            features = 'IMAGE_FSTYPES += " hddimg"\nMACHINE_FEATURES_append = " efi"\n'
+            self.append_config(features)
+            bitbake('core-image-minimal')
+            # set this class variable to avoid buiding image many times
+            Wic.image_is_ready = True
+
         rmtree(self.resultdir, ignore_errors=True)
 
     def test01_help(self):



More information about the Openembedded-commits mailing list