]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa/selftest/runqemu: Use snapshot mode for image testing
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Aug 2025 13:40:08 +0000 (14:40 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Aug 2025 21:32:18 +0000 (22:32 +0100)
We don't need to preserve changes to these images so use snapshot mode
so we don't save writes to them.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/runqemu.py

index bedcf975487a8f05bf2197945c7b285be4e427c7..74d47a6db1bcebc871140c4d82bdff2df5928218 100644 (file)
@@ -33,7 +33,7 @@ class RunqemuTests(OESelftestTestCase):
         if self.machine == "qemux86-64":
             self.fstypes += " wic.vmdk wic.qcow2 wic.vdi wic.zst"
 
-        self.cmd_common = "runqemu nographic"
+        self.cmd_common = "runqemu nographic snapshot"
         kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"])
         if kvm:
             self.cmd_common += " kvm"
@@ -192,7 +192,7 @@ class QemuTest(OESelftestTestCase):
         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"
+        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)
@@ -218,7 +218,7 @@ class QemuTest(OESelftestTestCase):
 
     def test_qemu_can_shutdown(self):
         self.assertExists(self.qemuboot_conf)
-        cmd = "%s %s" % (self.cmd_common, self.qemuboot_conf)
+        cmd = "%s snapshot %s" % (self.cmd_common, self.qemuboot_conf)
         shutdown_timeout = 120
         with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
             qemu_shutdown_succeeded = self._start_qemu_shutdown_check_if_shutdown_succeeded(qemu, shutdown_timeout)