diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/runqemu.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/runqemu.py | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py index f01e1eec66..7ed89e80de 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py | |||
@@ -31,9 +31,9 @@ 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 snapshot" |
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"]) |
38 | if kvm: | 38 | if kvm: |
39 | self.cmd_common += " kvm" | 39 | self.cmd_common += " kvm" |
@@ -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 |
@@ -173,9 +192,15 @@ class QemuTest(OESelftestTestCase): | |||
173 | cls.machine = get_bb_var('MACHINE') | 192 | cls.machine = get_bb_var('MACHINE') |
174 | cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') | 193 | cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') |
175 | cls.image_link_name = get_bb_var('IMAGE_LINK_NAME', cls.recipe) | 194 | cls.image_link_name = get_bb_var('IMAGE_LINK_NAME', cls.recipe) |
176 | cls.cmd_common = "runqemu nographic" | 195 | cls.cmd_common = "runqemu nographic snapshot" |
177 | cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name) | 196 | cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name) |
178 | cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf) | 197 | cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf) |
198 | |||
199 | cls.write_config(cls, | ||
200 | """ | ||
201 | IMAGE_FSTYPES += "tar.bz2" | ||
202 | """) | ||
203 | |||
179 | bitbake(cls.recipe) | 204 | bitbake(cls.recipe) |
180 | 205 | ||
181 | def _start_qemu_shutdown_check_if_shutdown_succeeded(self, qemu, timeout): | 206 | def _start_qemu_shutdown_check_if_shutdown_succeeded(self, qemu, timeout): |
@@ -199,7 +224,7 @@ class QemuTest(OESelftestTestCase): | |||
199 | 224 | ||
200 | def test_qemu_can_shutdown(self): | 225 | def test_qemu_can_shutdown(self): |
201 | self.assertExists(self.qemuboot_conf) | 226 | self.assertExists(self.qemuboot_conf) |
202 | cmd = "%s %s" % (self.cmd_common, self.qemuboot_conf) | 227 | cmd = "%s snapshot %s" % (self.cmd_common, self.qemuboot_conf) |
203 | shutdown_timeout = 120 | 228 | shutdown_timeout = 120 |
204 | with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: | 229 | with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: |
205 | qemu_shutdown_succeeded = self._start_qemu_shutdown_check_if_shutdown_succeeded(qemu, shutdown_timeout) | 230 | qemu_shutdown_succeeded = self._start_qemu_shutdown_check_if_shutdown_succeeded(qemu, shutdown_timeout) |