diff options
author | Ross Burton <ross@burtonini.com> | 2022-03-31 19:28:57 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-01 23:11:37 +0100 |
commit | 8d01207fd764aa2d5c01926681b7967e8ee9a612 (patch) | |
tree | 5f662006cd2bdaf010fca5076794ada4f338952b | |
parent | 6cd1a31bef217683152f5575592d04bf32861971 (diff) | |
download | poky-8d01207fd764aa2d5c01926681b7967e8ee9a612.tar.gz |
oeqa/selftest/wic: remove redundant asserts
By default bitbake() will raise an assertion if it fails, so there's no
need to wrap it in a further assert.
(From OE-Core rev: de3c8994dc482cf5e9f3317c4762fe4ac35d9f31)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 673942fc9c..5d7f7bf613 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -104,7 +104,7 @@ class WicTestCase(OESelftestTestCase): | |||
104 | def _get_image_env_path(self, image): | 104 | def _get_image_env_path(self, image): |
105 | """Generate and obtain the path to <image>.env""" | 105 | """Generate and obtain the path to <image>.env""" |
106 | if image not in WicTestCase.wicenv_cache: | 106 | if image not in WicTestCase.wicenv_cache: |
107 | self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status) | 107 | bitbake('%s -c do_rootfs_wicenv' % image) |
108 | bb_vars = get_bb_vars(['STAGING_DIR', 'MACHINE'], image) | 108 | bb_vars = get_bb_vars(['STAGING_DIR', 'MACHINE'], image) |
109 | stdir = bb_vars['STAGING_DIR'] | 109 | stdir = bb_vars['STAGING_DIR'] |
110 | machine = bb_vars['MACHINE'] | 110 | machine = bb_vars['MACHINE'] |
@@ -694,7 +694,7 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc | |||
694 | os.environ['PATH'] = get_bb_var("PATH", "wic-tools") | 694 | os.environ['PATH'] = get_bb_var("PATH", "wic-tools") |
695 | 695 | ||
696 | # Get stock fstab from base-files recipe | 696 | # Get stock fstab from base-files recipe |
697 | self.assertEqual(0, bitbake('base-files -c do_install').status) | 697 | bitbake('base-files -c do_install') |
698 | bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc/fstab') | 698 | bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc/fstab') |
699 | self.assertEqual(True, os.path.exists(bf_fstab)) | 699 | self.assertEqual(True, os.path.exists(bf_fstab)) |
700 | bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % bf_fstab).output.split(" ")[0] | 700 | bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % bf_fstab).output.split(" ")[0] |
@@ -828,7 +828,7 @@ class Wic2(WicTestCase): | |||
828 | config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ | 828 | config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ |
829 | 'MACHINE_FEATURES:append = " efi"\n' | 829 | 'MACHINE_FEATURES:append = " efi"\n' |
830 | self.append_config(config) | 830 | self.append_config(config) |
831 | self.assertEqual(0, bitbake('wic-image-minimal').status) | 831 | bitbake('wic-image-minimal') |
832 | self.remove_config(config) | 832 | self.remove_config(config) |
833 | 833 | ||
834 | bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE']) | 834 | bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE']) |
@@ -848,7 +848,7 @@ class Wic2(WicTestCase): | |||
848 | config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ | 848 | config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ |
849 | 'MACHINE_FEATURES:append = " efi"\n' | 849 | 'MACHINE_FEATURES:append = " efi"\n' |
850 | self.append_config(config) | 850 | self.append_config(config) |
851 | self.assertEqual(0, bitbake('wic-image-minimal').status) | 851 | bitbake('wic-image-minimal') |
852 | self.remove_config(config) | 852 | self.remove_config(config) |
853 | 853 | ||
854 | with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu: | 854 | with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu: |
@@ -867,7 +867,7 @@ class Wic2(WicTestCase): | |||
867 | """Test core-image-minimal efi image under qemu""" | 867 | """Test core-image-minimal efi image under qemu""" |
868 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n' | 868 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n' |
869 | self.append_config(config) | 869 | self.append_config(config) |
870 | self.assertEqual(0, bitbake('core-image-minimal ovmf').status) | 870 | bitbake('core-image-minimal ovmf') |
871 | self.remove_config(config) | 871 | self.remove_config(config) |
872 | 872 | ||
873 | with runqemu('core-image-minimal', ssh=False, | 873 | with runqemu('core-image-minimal', ssh=False, |
@@ -1051,12 +1051,12 @@ class Wic2(WicTestCase): | |||
1051 | # build ext4 and then use it for a wic image | 1051 | # build ext4 and then use it for a wic image |
1052 | config = 'IMAGE_FSTYPES = "ext4"\n' | 1052 | config = 'IMAGE_FSTYPES = "ext4"\n' |
1053 | self.append_config(config) | 1053 | self.append_config(config) |
1054 | self.assertEqual(0, bitbake('core-image-minimal').status) | 1054 | bitbake('core-image-minimal') |
1055 | self.remove_config(config) | 1055 | self.remove_config(config) |
1056 | 1056 | ||
1057 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' | 1057 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' |
1058 | self.append_config(config) | 1058 | self.append_config(config) |
1059 | self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status) | 1059 | bitbake('core-image-minimal-mtdutils') |
1060 | self.remove_config(config) | 1060 | self.remove_config(config) |
1061 | 1061 | ||
1062 | with runqemu('core-image-minimal-mtdutils', ssh=False, | 1062 | with runqemu('core-image-minimal-mtdutils', ssh=False, |
@@ -1096,7 +1096,7 @@ class Wic2(WicTestCase): | |||
1096 | """Test empty plugin""" | 1096 | """Test empty plugin""" |
1097 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n' | 1097 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n' |
1098 | self.append_config(config) | 1098 | self.append_config(config) |
1099 | self.assertEqual(0, bitbake('core-image-minimal').status) | 1099 | bitbake('core-image-minimal') |
1100 | self.remove_config(config) | 1100 | self.remove_config(config) |
1101 | 1101 | ||
1102 | bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE']) | 1102 | bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE']) |
@@ -1117,7 +1117,7 @@ class Wic2(WicTestCase): | |||
1117 | """Test biosplusefi plugin in qemu""" | 1117 | """Test biosplusefi plugin in qemu""" |
1118 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n' | 1118 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n' |
1119 | self.append_config(config) | 1119 | self.append_config(config) |
1120 | self.assertEqual(0, bitbake('core-image-minimal').status) | 1120 | bitbake('core-image-minimal') |
1121 | self.remove_config(config) | 1121 | self.remove_config(config) |
1122 | 1122 | ||
1123 | with runqemu('core-image-minimal', ssh=False, | 1123 | with runqemu('core-image-minimal', ssh=False, |
@@ -1155,7 +1155,7 @@ class Wic2(WicTestCase): | |||
1155 | # The easiest way to work-around this issue is to make sure we already built an image here, hence the bitbake call | 1155 | # The easiest way to work-around this issue is to make sure we already built an image here, hence the bitbake call |
1156 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n' | 1156 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n' |
1157 | self.append_config(config) | 1157 | self.append_config(config) |
1158 | self.assertEqual(0, bitbake('core-image-minimal').status) | 1158 | bitbake('core-image-minimal') |
1159 | self.remove_config(config) | 1159 | self.remove_config(config) |
1160 | 1160 | ||
1161 | img = 'core-image-minimal' | 1161 | img = 'core-image-minimal' |
@@ -1178,7 +1178,7 @@ class Wic2(WicTestCase): | |||
1178 | 'WKS_FILE = "test_efi_plugin.wks"\n'\ | 1178 | 'WKS_FILE = "test_efi_plugin.wks"\n'\ |
1179 | 'MACHINE_FEATURES:append = " efi"\n' | 1179 | 'MACHINE_FEATURES:append = " efi"\n' |
1180 | self.append_config(config) | 1180 | self.append_config(config) |
1181 | self.assertEqual(0, bitbake('core-image-minimal core-image-minimal-initramfs ovmf').status) | 1181 | bitbake('core-image-minimal core-image-minimal-initramfs ovmf') |
1182 | self.remove_config(config) | 1182 | self.remove_config(config) |
1183 | 1183 | ||
1184 | with runqemu('core-image-minimal', ssh=False, | 1184 | with runqemu('core-image-minimal', ssh=False, |
@@ -1382,7 +1382,7 @@ class Wic2(WicTestCase): | |||
1382 | # build an image | 1382 | # build an image |
1383 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "directdisk.wks"\n' | 1383 | config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "directdisk.wks"\n' |
1384 | self.append_config(config) | 1384 | self.append_config(config) |
1385 | self.assertEqual(0, bitbake('core-image-minimal').status) | 1385 | bitbake('core-image-minimal') |
1386 | 1386 | ||
1387 | # get path to the image | 1387 | # get path to the image |
1388 | bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE']) | 1388 | bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE']) |