]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/selftest/wic: don't hardcode kernel image type in test_wic_rm
authorRoss Burton <ross@burtonini.com>
Thu, 31 Mar 2022 18:28:59 +0000 (19:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Apr 2022 22:05:31 +0000 (23:05 +0100)
Don't assume bzImage, resepct KERNEL_IMAGETYPE.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/lib/oeqa/selftest/cases/wic.py

index 317b80ea27b7a002055adca9356374f49d2a9372..eb376e1e2c5fbc08a82743476ca518da5241656d 100644 (file)
@@ -1337,21 +1337,23 @@ class Wic2(WicTestCase):
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+        # Not bulletproof but hopefully sufficient
+        kerneltype = get_bb_var('KERNEL_IMAGETYPE', 'virtual/kernel')
 
         # list directory content of the first partition
         result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
-        self.assertIn('\nBZIMAGE        ', result.output)
+        self.assertIn('\n%s        ' % kerneltype.upper(), result.output)
         self.assertIn('\nEFI          <DIR>     ', result.output)
 
-        # remove file
-        runCmd("wic rm %s:1/bzimage -n %s" % (images[0], sysroot))
+        # remove file. EFI partitions are case-insensitive so exercise that too
+        runCmd("wic rm %s:1/%s -n %s" % (images[0], kerneltype.lower(), sysroot))
 
         # remove directory
         runCmd("wic rm %s:1/efi -n %s" % (images[0], sysroot))
 
         # check if they're removed
         result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
-        self.assertNotIn('\nBZIMAGE        ', result.output)
+        self.assertNotIn('\n%s        ' % kerneltype.upper(), result.output)
         self.assertNotIn('\nEFI          <DIR>     ', result.output)
 
     def test_mkfs_extraopts(self):