summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-10-15 16:53:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-21 22:56:07 +0100
commita66ed339d924d47bdaef5cf31ca888af3b6b78c6 (patch)
tree9d498ab9129c38b3e2fa8c27d0c40d998a5691a7 /meta/lib
parentb67b1a426ddf7a1807864e17f2bf69c84c21392f (diff)
downloadpoky-a66ed339d924d47bdaef5cf31ca888af3b6b78c6.tar.gz
oeqa/selftest/wic: fix cleaning
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. (From OE-Core rev: 2285ff17a391fa22f2095da701bc6f2c9615ae7b) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/wic.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index f4c22f789c..ca9a5981bd 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -38,22 +38,19 @@ class Wic(oeSelfTest):
38 """Wic test class.""" 38 """Wic test class."""
39 39
40 resultdir = "/var/tmp/wic/build/" 40 resultdir = "/var/tmp/wic/build/"
41 41 image_is_ready = False
42 @classmethod
43 def setUpClass(cls):
44 """Build wic runtime dependencies."""
45 bitbake('syslinux syslinux-native parted-native gptfdisk-native '
46 'dosfstools-native mtools-native')
47 Wic.image_is_ready = False
48 42
49 def setUpLocal(self): 43 def setUpLocal(self):
50 """This code is executed before each test method.""" 44 """This code is executed before each test method."""
51 features = 'IMAGE_FSTYPES += " hddimg"\nMACHINE_FEATURES_append = " efi"\n' 45 self.write_config('IMAGE_FSTYPES += " hddimg"\nMACHINE_FEATURES_append = " efi"\n')
52 self.append_config(features) 46
47 # Do this here instead of in setUpClass as the base setUp does some
48 # clean up which can result in the native tools built earlier in
49 # setUpClass being unavailable.
53 if not Wic.image_is_ready: 50 if not Wic.image_is_ready:
54 # build core-image-minimal with required features 51 bitbake('syslinux syslinux-native parted-native gptfdisk-native '
52 'dosfstools-native mtools-native')
55 bitbake('core-image-minimal') 53 bitbake('core-image-minimal')
56 # set this class variable to avoid buiding image many times
57 Wic.image_is_ready = True 54 Wic.image_is_ready = True
58 55
59 rmtree(self.resultdir, ignore_errors=True) 56 rmtree(self.resultdir, ignore_errors=True)