diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-19 13:30:36 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-28 22:31:47 +0100 |
commit | eac29d491afe3bc6ad468b38b80a3daadcc76aba (patch) | |
tree | adebf5a334d404ff3adb89e70b61c4fa3fe37eda /meta/lib | |
parent | 5b67ea6dc5338d0716d58e6d3481356cc19696d9 (diff) | |
download | poky-eac29d491afe3bc6ad468b38b80a3daadcc76aba.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: d30a90062e29a3069f6e8d9f6d4eadd7a48adf4f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 590398080e81fb5e2f81e12b8900858837dfe25f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 18 |
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 0435aa29c9..f7abdba015 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -905,14 +905,18 @@ class Wic2(WicTestCase): | |||
905 | @only_for_arch(['i586', 'i686', 'x86_64']) | 905 | @only_for_arch(['i586', 'i686', 'x86_64']) |
906 | def test_rawcopy_plugin_qemu(self): | 906 | def test_rawcopy_plugin_qemu(self): |
907 | """Test rawcopy plugin in qemu""" | 907 | """Test rawcopy plugin in qemu""" |
908 | # build ext4 and wic images | 908 | # build ext4 and then use it for a wic image |
909 | for fstype in ("ext4", "wic"): | 909 | config = 'IMAGE_FSTYPES = "ext4"\n' |
910 | config = 'IMAGE_FSTYPES = "%s"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' % fstype | 910 | self.append_config(config) |
911 | self.append_config(config) | 911 | self.assertEqual(0, bitbake('core-image-minimal').status) |
912 | self.assertEqual(0, bitbake('core-image-minimal').status) | 912 | self.remove_config(config) |
913 | self.remove_config(config) | ||
914 | 913 | ||
915 | with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu: | 914 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' |
915 | self.append_config(config) | ||
916 | self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status) | ||
917 | self.remove_config(config) | ||
918 | |||
919 | with runqemu('core-image-minimal-mtdutils', ssh=False, image_fstype='wic') as qemu: | ||
916 | cmd = "grep sda. /proc/partitions |wc -l" | 920 | cmd = "grep sda. /proc/partitions |wc -l" |
917 | status, output = qemu.run_serial(cmd) | 921 | status, output = qemu.run_serial(cmd) |
918 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) | 922 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |