aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-19 13:30:36 +0000
committerAnuj Mittal <anuj.mittal@intel.com>2021-04-09 13:58:19 +0800
commite444836c5a5c07647ee860e0eea281144bd0595f (patch)
tree0be2ad6500f93df9934e1871c70a58d08235ff7e
parent9bdc9a1da39017cd54434e49f14ab2d8ba75930a (diff)
downloadopenembedded-core-contrib-e444836c5a5c07647ee860e0eea281144bd0595f.tar.gz
openembedded-core-contrib-e444836c5a5c07647ee860e0eea281144bd0595f.tar.bz2
openembedded-core-contrib-e444836c5a5c07647ee860e0eea281144bd0595f.zip
selftest/wic: Fix dependency issue in rawcopy test
The current test code contains a subtle race. It is building an ext4, then trying to reuse that image in a wic build for the same recipe. Whilst this happened to work, the code is within its rights to clean up the output before the wic code runs. Avoid this by using separate image targets instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 590398080e81fb5e2f81e12b8900858837dfe25f) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index df2d2d225ea..39c6828f591 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -979,14 +979,18 @@ class Wic2(WicTestCase):
@only_for_arch(['i586', 'i686', 'x86_64'])
def test_rawcopy_plugin_qemu(self):
"""Test rawcopy plugin in qemu"""
- # build ext4 and wic images
- for fstype in ("ext4", "wic"):
- config = 'IMAGE_FSTYPES = "%s"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' % fstype
- self.append_config(config)
- self.assertEqual(0, bitbake('core-image-minimal').status)
- self.remove_config(config)
+ # build ext4 and then use it for a wic image
+ config = 'IMAGE_FSTYPES = "ext4"\n'
+ self.append_config(config)
+ self.assertEqual(0, bitbake('core-image-minimal').status)
+ self.remove_config(config)
- with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu:
+ config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n'
+ self.append_config(config)
+ self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status)
+ self.remove_config(config)
+
+ with runqemu('core-image-minimal-mtdutils', ssh=False, image_fstype='wic') as qemu:
cmd = "grep sda. /proc/partitions |wc -l"
status, output = qemu.run_serial(cmd)
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))