提交 e5ecd86f 编写于 作者: C Cong Li

qemu.tests: Add new case of live snapshot during installation.

Signed-off-by: NCong Li <coli@redhat.com>
上级 be38f2ab
...@@ -36,6 +36,23 @@ ...@@ -36,6 +36,23 @@
filesize = 2000 filesize = 2000
transfer_timeout = 1200 transfer_timeout = 1200
tmp_dir = /var/tmp/ tmp_dir = /var/tmp/
- with_installation:
subcommand = installation
need_install = yes
start_vm = no
images = "stg"
image_name_stg = "images/live_snapshot_base"
image_size_stg = 20G
boot_drive_stg = yes
medium = cdrom
installation = cdrom
kernel = vmlinuz
initrd = initrd.img
force_create_image_stg = yes
image_aio = threads
unattended_delivery_method = cdrom
cdroms += " unattended"
index_enable = no
- base: - base:
type = live_snapshot_base type = live_snapshot_base
backup_image_before_testing = yes backup_image_before_testing = yes
......
...@@ -2,6 +2,7 @@ import time ...@@ -2,6 +2,7 @@ import time
import logging import logging
from autotest.client.shared import error from autotest.client.shared import error
from autotest.client.shared import utils
from virttest import utils_test from virttest import utils_test
...@@ -43,11 +44,12 @@ def run(test, params, env): ...@@ -43,11 +44,12 @@ def run(test, params, env):
logging.error(snapshot_info) logging.error(snapshot_info)
raise error.TestFail("Snapshot doesn't exist") raise error.TestFail("Snapshot doesn't exist")
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
timeout = int(params.get("login_timeout", 360)) timeout = int(params.get("login_timeout", 360))
dd_timeout = int(params.get("dd_timeout", 900)) dd_timeout = int(params.get("dd_timeout", 900))
session = vm.wait_for_login(timeout=timeout) vm = env.get_vm(params["main_vm"])
if params.get("need_install", "no") == "no":
vm.verify_alive()
session = vm.wait_for_login(timeout=timeout)
def runtime_test(): def runtime_test():
try: try:
...@@ -102,5 +104,21 @@ def run(test, params, env): ...@@ -102,5 +104,21 @@ def run(test, params, env):
raise raise
finally: finally:
session.close() session.close()
def installation_test():
args = (test, params, env)
bg = utils.InterruptedThread(
utils_test.run_virt_sub_test, args,
{"sub_type": "unattended_install"})
bg.start()
if bg.is_alive():
sleep_time = int(params.get("sleep_time", 60))
time.sleep(sleep_time)
create_snapshot(vm)
try:
bg.join()
except Exception:
raise
subcommand = params.get("subcommand") subcommand = params.get("subcommand")
eval("%s_test()" % subcommand) eval("%s_test()" % subcommand)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册