summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa
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:55:02 +0100
commit2285ff17a391fa22f2095da701bc6f2c9615ae7b (patch)
tree0befae251887f192d7709801b8840c75be623feb /meta/lib/oeqa
parentb845330133de6d47b63a03208aa083cf08801634 (diff)
downloadopenembedded-core-2285ff17a391fa22f2095da701bc6f2c9615ae7b.tar.gz
openembedded-core-2285ff17a391fa22f2095da701bc6f2c9615ae7b.tar.bz2
openembedded-core-2285ff17a391fa22f2095da701bc6f2c9615ae7b.zip
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. Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa')
-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):
"""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)