提交 a719d46c 编写于 作者: Q Qingtang Zhou 提交者: Lucas Meneghel Rodrigues

qemu.tests.system_reset_bootable: Start vm in this test explicitly

The vm.verify_alive() function contains some steps to verify the
guest is alive, these steps will cost extra time, and it could
make the boottime checking doesn't exactly match the real situation.

Hence disable the vm starting step in framework and just try to
wait_for_login after starting the vm.
Signed-off-by: NQingtang Zhou <qzhou@redhat.com>
Acked-by: NYiqiao Pu <ypu@redhat.com>
上级 def557e1
......@@ -4,3 +4,4 @@
reset_times = 20
wait_time_for_reset = 120
kill_vm_on_error = yes
start_vm = no
......@@ -6,3 +6,4 @@
reset_during_boot = yes
fixed_interval = no
image_verify_bootable = no
start_vm = no
......@@ -18,21 +18,23 @@ def run_system_reset_bootable(test, params, env):
@param env: Dictionary with test environment.
"""
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
timeout = float(params.get("login_timeout", 240))
reset_times = int(params.get("reset_times",20))
interval = int(params.get("reset_interval",10))
wait_time = int(params.get("wait_time_for_reset",60))
reset_times = int(params.get("reset_times", 20))
interval = int(params.get("reset_interval", 10))
wait_time = int(params.get("wait_time_for_reset", 60))
if params.get("get_boot_time") == "yes":
error.context("Check guest boot up time", logging.info)
vm.create()
vm.wait_for_login(timeout=timeout)
bootup_time = time.time() - vm.start_time
if params.get("reset_during_boot") == "yes":
interval = int(bootup_time)
wait_time = random.randint(0, int(bootup_time))
vm.destroy()
vm.create()
error.context("Boot the guest", logging.info)
vm.create()
logging.info("Wait for %d seconds before reset" % wait_time)
time.sleep(wait_time)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册