1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

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>
This commit is contained in:
Ross Burton
2015-10-15 16:53:47 +01:00
committed by Richard Purdie
parent b67b1a426d
commit a66ed339d9
+8 -11
View 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)