public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 05/23] oeqa/selftest/wic: remove redundant asserts
Date: Thu, 31 Mar 2022 19:28:57 +0100	[thread overview]
Message-ID: <20220331182915.22128-5-ross.burton@arm.com> (raw)
In-Reply-To: <20220331182915.22128-1-ross.burton@arm.com>

By default bitbake() will raise an assertion if it fails, so there's no
need to wrap it in a further assert.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oeqa/selftest/cases/wic.py | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 673942fc9cc..5d7f7bf6135 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -104,7 +104,7 @@ class WicTestCase(OESelftestTestCase):
     def _get_image_env_path(self, image):
         """Generate and obtain the path to <image>.env"""
         if image not in WicTestCase.wicenv_cache:
-            self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
+            bitbake('%s -c do_rootfs_wicenv' % image)
             bb_vars = get_bb_vars(['STAGING_DIR', 'MACHINE'], image)
             stdir = bb_vars['STAGING_DIR']
             machine = bb_vars['MACHINE']
@@ -694,7 +694,7 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
         os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
 
         # Get stock fstab from base-files recipe
-        self.assertEqual(0, bitbake('base-files -c do_install').status)
+        bitbake('base-files -c do_install')
         bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc/fstab')
         self.assertEqual(True, os.path.exists(bf_fstab))
         bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % bf_fstab).output.split(" ")[0]
@@ -828,7 +828,7 @@ class Wic2(WicTestCase):
         config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
                  'MACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('wic-image-minimal').status)
+        bitbake('wic-image-minimal')
         self.remove_config(config)
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
@@ -848,7 +848,7 @@ class Wic2(WicTestCase):
         config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
                  'MACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('wic-image-minimal').status)
+        bitbake('wic-image-minimal')
         self.remove_config(config)
 
         with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
@@ -867,7 +867,7 @@ class Wic2(WicTestCase):
         """Test core-image-minimal efi image under qemu"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal ovmf').status)
+        bitbake('core-image-minimal ovmf')
         self.remove_config(config)
 
         with runqemu('core-image-minimal', ssh=False,
@@ -1051,12 +1051,12 @@ class Wic2(WicTestCase):
         # 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)
+        bitbake('core-image-minimal')
         self.remove_config(config)
 
         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)
+        bitbake('core-image-minimal-mtdutils')
         self.remove_config(config)
 
         with runqemu('core-image-minimal-mtdutils', ssh=False,
@@ -1096,7 +1096,7 @@ class Wic2(WicTestCase):
         """Test empty plugin"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
         self.remove_config(config)
 
         bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
@@ -1117,7 +1117,7 @@ class Wic2(WicTestCase):
         """Test biosplusefi plugin in qemu"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
         self.remove_config(config)
 
         with runqemu('core-image-minimal', ssh=False,
@@ -1155,7 +1155,7 @@ class Wic2(WicTestCase):
         # The easiest way to work-around this issue is to make sure we already built an image here, hence the bitbake call
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
         self.remove_config(config)
 
         img = 'core-image-minimal'
@@ -1178,7 +1178,7 @@ class Wic2(WicTestCase):
                  'WKS_FILE = "test_efi_plugin.wks"\n'\
                  'MACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal core-image-minimal-initramfs ovmf').status)
+        bitbake('core-image-minimal core-image-minimal-initramfs ovmf')
         self.remove_config(config)
 
         with runqemu('core-image-minimal', ssh=False,
@@ -1382,7 +1382,7 @@ class Wic2(WicTestCase):
         # build an image
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "directdisk.wks"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
 
         # get path to the image
         bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
-- 
2.25.1



  parent reply	other threads:[~2022-03-31 18:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 18:28 [PATCH 01/23] buildtools-tarball: include nativesdk-python3-pyyaml Ross Burton
2022-03-31 18:28 ` [PATCH 02/23] image_types: hddimg and iso only work on x86 Ross Burton
2022-03-31 18:28 ` [PATCH 03/23] oeqa/selftest/devtool: ensure Git username is set before upgrade tests Ross Burton
2022-03-31 18:28 ` [PATCH 04/23] oeqa/selftest/wic: use os.rename instead of bb.utils.rename Ross Burton
2022-03-31 18:28 ` Ross Burton [this message]
2022-03-31 18:28 ` [PATCH 06/23] oeqa/selftest/wic: clean up only_for_arch decorator Ross Burton
2022-03-31 18:28 ` [PATCH 07/23] oeqa/selftest/wic: don't hardcode kernel image type in test_wic_rm Ross Burton
2022-03-31 18:29 ` [PATCH 08/23] oeqa/selftest/wic: add more arch-specific annotations Ross Burton
2022-03-31 18:29 ` [PATCH 09/23] oeqa/selftest/buildoptions: set PACKAGE_CLASSES in test_arch_work_dir_and_export_source Ross Burton
2022-03-31 18:29 ` [PATCH 10/23] oeqa/runtime/decorator/package.py: remove use of strToSet Ross Burton
2022-03-31 18:29 ` [PATCH 11/23] oeqa/core/decorator: remove redundant code Ross Burton
2022-03-31 18:29 ` [PATCH 12/23] testimage: inline updateTestData() Ross Burton
2022-03-31 18:29 ` [PATCH 13/23] oeqa/core/utils/misc: remove redundant file Ross Burton
2022-03-31 18:29 ` [PATCH 14/23] oeqa/selftest: remove unused imports Ross Burton
2022-03-31 18:29 ` [PATCH 15/23] oeqa/core/decorators/data: improve has_* logic Ross Burton
2022-03-31 18:29 ` [PATCH 16/23] oeqa/selftest: tag tests that use runqemu Ross Burton
2022-03-31 18:29 ` [PATCH 17/23] oeqa: rationalise skipifqemu decorators Ross Burton
2022-03-31 18:29 ` [PATCH 18/23] oeqa/selftest/oescripts: refactor skipping logic Ross Burton
2022-03-31 18:29 ` [PATCH 19/23] oeqa/selftest/wic: cleanup WicTestCase.setUpLocal Ross Burton
2022-03-31 18:29 ` [PATCH 20/23] oeqa/selftest/wic: rearrange tests Ross Burton
2022-03-31 18:29 ` [PATCH 21/23] oeqa/selftest/wic: use os.path.join to join paths Ross Burton
2022-03-31 18:29 ` [PATCH 22/23] oeqa/selftest/wic: use self.td instead of get_bb_var to save on bitbake calls Ross Burton
2022-03-31 18:29 ` [PATCH 23/23] oeqa/selftest: generalise test_devtool_virtual_kernel_modify Ross Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220331182915.22128-5-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox