diff options
author | Yoann Congal <yoann.congal@smile.fr> | 2025-07-31 17:33:11 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-06 22:32:41 +0100 |
commit | 89bd495091dfdcd3211761dc601ea1e81ae4ced7 (patch) | |
tree | 72949096785e69e4ac17618d6d896f3f2848e904 | |
parent | 820a6edcec880ff02deb3fdb0a60832e57726bcd (diff) | |
download | poky-89bd495091dfdcd3211761dc601ea1e81ae4ced7.tar.gz |
selftest: runqemu: add tests for booting zst compressed image
Add a simple tests booting a compressed image given to runqemu as path
and as image recipe name.
(From OE-Core rev: b5f8c3e02980df0e8e44de32ed8b3b869a1fcd83)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/runqemu.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py index f01e1eec66..bedcf97548 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py | |||
@@ -31,7 +31,7 @@ class RunqemuTests(OESelftestTestCase): | |||
31 | if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'): | 31 | if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'): |
32 | self.fstypes += " iso hddimg" | 32 | self.fstypes += " iso hddimg" |
33 | if self.machine == "qemux86-64": | 33 | if self.machine == "qemux86-64": |
34 | self.fstypes += " wic.vmdk wic.qcow2 wic.vdi" | 34 | self.fstypes += " wic.vmdk wic.qcow2 wic.vdi wic.zst" |
35 | 35 | ||
36 | self.cmd_common = "runqemu nographic" | 36 | self.cmd_common = "runqemu nographic" |
37 | kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"]) | 37 | kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"]) |
@@ -152,6 +152,25 @@ SYSLINUX_TIMEOUT = "10" | |||
152 | with open(qemu.qemurunnerlog) as f: | 152 | with open(qemu.qemurunnerlog) as f: |
153 | self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) | 153 | self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) |
154 | 154 | ||
155 | @skipIfNotMachine("qemux86-64", "wic tests are qemux86-64 specific currently") | ||
156 | def test_boot_compressed_wic_by_path(self): | ||
157 | """Test runqemu /path/to/rootfs.wic.zst""" | ||
158 | rootfs = "%s.wic.zst" % (self.image_link_name) | ||
159 | rootfs = os.path.join(self.deploy_dir_image, rootfs) | ||
160 | if not os.path.exists(rootfs): | ||
161 | self.skipTest("%s not found" % rootfs) | ||
162 | cmd = "%s %s snapshot" % (self.cmd_common, rootfs) | ||
163 | with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: | ||
164 | with open(qemu.qemurunnerlog) as f: | ||
165 | self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) | ||
166 | |||
167 | @skipIfNotMachine("qemux86-64", "wic tests are qemux86-64 specific currently") | ||
168 | def test_boot_compressed_wic_by_recipe(self): | ||
169 | """Test runqemu recipe-image wic.zst""" | ||
170 | cmd = "%s %s snapshot wic.zst" % (self.cmd_common, self.recipe) | ||
171 | with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: | ||
172 | with open(qemu.qemurunnerlog) as f: | ||
173 | self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) | ||
155 | 174 | ||
156 | # This test was designed as a separate class to test that shutdown | 175 | # This test was designed as a separate class to test that shutdown |
157 | # command will shutdown qemu as expected on each qemu architecture | 176 | # command will shutdown qemu as expected on each qemu architecture |