summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-19 13:30:36 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-20 18:54:56 +0000
commit9825a860eef8b6003c917969805cc2975ffeb3dc (patch)
tree09824a48216d4e594bf201feb53fc8c27ff6a51d /meta/lib/oeqa
parent2cb12498f911c166286fb2cf7b41bba269ffb7bd (diff)
downloadpoky-9825a860eef8b6003c917969805cc2975ffeb3dc.tar.gz
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. (From OE-Core rev: 590398080e81fb5e2f81e12b8900858837dfe25f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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 2bf5cb9a86..fa81584a8c 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -979,14 +979,18 @@ class Wic2(WicTestCase):
979 @only_for_arch(['i586', 'i686', 'x86_64']) 979 @only_for_arch(['i586', 'i686', 'x86_64'])
980 def test_rawcopy_plugin_qemu(self): 980 def test_rawcopy_plugin_qemu(self):
981 """Test rawcopy plugin in qemu""" 981 """Test rawcopy plugin in qemu"""
982 # build ext4 and wic images 982 # build ext4 and then use it for a wic image
983 for fstype in ("ext4", "wic"): 983 config = 'IMAGE_FSTYPES = "ext4"\n'
984 config = 'IMAGE_FSTYPES = "%s"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' % fstype 984 self.append_config(config)
985 self.append_config(config) 985 self.assertEqual(0, bitbake('core-image-minimal').status)
986 self.assertEqual(0, bitbake('core-image-minimal').status) 986 self.remove_config(config)
987 self.remove_config(config)
988 987
989 with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu: 988 config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n'
989 self.append_config(config)
990 self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status)
991 self.remove_config(config)
992
993 with runqemu('core-image-minimal-mtdutils', ssh=False, image_fstype='wic') as qemu:
990 cmd = "grep sda. /proc/partitions |wc -l" 994 cmd = "grep sda. /proc/partitions |wc -l"
991 status, output = qemu.run_serial(cmd) 995 status, output = qemu.run_serial(cmd)
992 self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) 996 self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))