]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/selftest/wic: fix cleaning
authorRoss Burton <ross.burton@intel.com>
Thu, 15 Oct 2015 15:53:47 +0000 (16:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Oct 2015 21:55:02 +0000 (22:55 +0100)
In some situations the native tools built in setUpClass() are wiped from the
sysroot by the time the tests are executed, likely due to the cleanup performed
in the base setUp() method.

Avoid this by doing all of the preparatory building in setUpLocal.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/selftest/wic.py

index f4c22f789cbee83880cde8d3f1b718a6d7f21985..ca9a5981bd6536ea992b2e7d1d57bbcbf6cd3d25 100644 (file)
@@ -38,22 +38,19 @@ class Wic(oeSelfTest):
     """Wic test class."""
 
     resultdir = "/var/tmp/wic/build/"
-
-    @classmethod
-    def setUpClass(cls):
-        """Build wic runtime dependencies."""
-        bitbake('syslinux syslinux-native parted-native gptfdisk-native '
-                'dosfstools-native mtools-native')
-        Wic.image_is_ready = False
+    image_is_ready = False
 
     def setUpLocal(self):
         """This code is executed before each test method."""
-        features = 'IMAGE_FSTYPES += " hddimg"\nMACHINE_FEATURES_append = " efi"\n'
-        self.append_config(features)
+        self.write_config('IMAGE_FSTYPES += " hddimg"\nMACHINE_FEATURES_append = " efi"\n')
+
+        # Do this here instead of in setUpClass as the base setUp does some
+        # clean up which can result in the native tools built earlier in
+        # setUpClass being unavailable.
         if not Wic.image_is_ready:
-            # build core-image-minimal with required features
+            bitbake('syslinux syslinux-native parted-native gptfdisk-native '
+                    'dosfstools-native mtools-native')
             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)