From: Adrian Freihofer Date: Tue, 20 Jan 2026 05:54:06 +0000 (+0100) Subject: oe-selftest: runqemu: use zst rootfs for test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9d501388f3c7edc22474d7136e3b627eed9f807;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git oe-selftest: runqemu: use zst rootfs for test Use .tar.zst as rootfs IMAGE_FSTYPES in the runqemu selftest to make the test quicker and more relevant to current usage. Simplify changing the IMAGE_FSTYPES for the test. Improve the test speed by using get_bb_vars to get multiple bb vars at once. Signed-off-by: Adrian Freihofer Signed-off-by: Antonin Godard Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py index 7ed89e80de..bfa76812ae 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py @@ -11,7 +11,7 @@ import oe.types from oeqa.core.decorator import OETestTag from oeqa.core.decorator.data import skipIfNotArch, skipIfNotMachine from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, runqemu, get_bb_var +from oeqa.utils.commands import bitbake, runqemu, get_bb_var, get_bb_vars @OETestTag("runqemu") @@ -189,17 +189,25 @@ class QemuTest(OESelftestTestCase): def setUpClass(cls): super(QemuTest, cls).setUpClass() cls.recipe = 'core-image-minimal' - cls.machine = get_bb_var('MACHINE') - cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - cls.image_link_name = get_bb_var('IMAGE_LINK_NAME', cls.recipe) - cls.cmd_common = "runqemu nographic snapshot" - cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name) - cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf) + cls.image_fstypes = "tar.zst" cls.write_config(cls, """ -IMAGE_FSTYPES += "tar.bz2" -""") +IMAGE_FSTYPES += "%s" +""" % cls.image_fstypes) + + bb_vars = get_bb_vars([ + 'DEPLOY_DIR_IMAGE', + 'IMAGE_LINK_NAME', + 'MACHINE', + ], + cls.recipe) + cls.deploy_dir_image = bb_vars['DEPLOY_DIR_IMAGE'] + cls.image_link_name = bb_vars['IMAGE_LINK_NAME'] + cls.machine = bb_vars['MACHINE'] + cls.cmd_common = "runqemu nographic snapshot" + cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name) + cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf) bitbake(cls.recipe) @@ -231,7 +239,7 @@ IMAGE_FSTYPES += "tar.bz2" self.assertTrue(qemu_shutdown_succeeded, 'Failed: %s does not shutdown within timeout(%s)' % (self.machine, shutdown_timeout)) def test_qemu_can_boot_nfs_and_shutdown(self): - rootfs_tar = "%s.tar.bz2" % (self.image_link_name) + rootfs_tar = "%s.%s" % (self.image_link_name, self.image_fstypes) rootfs_tar = os.path.join(self.deploy_dir_image, rootfs_tar) self.assertExists(rootfs_tar) cmd = "%s %s" % (self.cmd_common, rootfs_tar)