@@ -20,15 +20,9 @@ def run_boot(test, params, env):
timeout = float(params.get("login_timeout", 240))
session = vm.wait_for_login(timeout=timeout)
- try:
- if not params.get("reboot_method"):
- return
+ if params.get("reboot_method"):
+ if params["reboot_method"] == "system_reset":
+ time.sleep(int(params.get("sleep_before_reset", 10)))
+ session = vm.reboot(session, params["reboot_method"], 0, timeout)
- # Reboot the VM
- session = kvm_test_utils.reboot(vm, session,
- params.get("reboot_method"),
- float(params.get("sleep_before_reset", 10)),
- 0, timeout)
-
- finally:
- session.close()
+ session.close()
@@ -28,7 +28,7 @@ def run_guest_test(test, params, env):
if reboot == "yes":
logging.debug("Rebooting guest before test ...")
- session = kvm_test_utils.reboot(vm, session, timeout=login_timeout)
+ session = vm.reboot(session, timeout=login_timeout)
try:
logging.info("Starting script...")
@@ -74,7 +74,7 @@ def run_guest_test(test, params, env):
if reboot == "yes":
logging.debug("Rebooting guest after test ...")
- session = kvm_test_utils.reboot(vm, session, timeout=login_timeout)
+ session = vm.reboot(session, timeout=login_timeout)
logging.debug("guest test PASSED.")
finally:
@@ -82,8 +82,7 @@ def run_iofuzz(test, params, env):
session = vm.wait_for_login(timeout=10)
except:
logging.debug("Could not re-login, reboot the guest")
- session = kvm_test_utils.reboot(vm, session,
- method = "system_reset")
+ session = vm.reboot(method="system_reset")
else:
raise error.TestFail("VM has quit abnormally during %s",
(op, operand))
@@ -61,7 +61,7 @@ def run_kdump(test, params, env):
except:
logging.info("Crash kernel is not loaded. Trying to load it")
session.cmd(kernel_param_cmd)
- session = kvm_test_utils.reboot(vm, session, timeout=timeout)
+ session = vm.reboot(session, timeout=timeout)
logging.info("Enabling kdump service...")
# the initrd may be rebuilt here so we need to wait a little more
@@ -30,7 +30,7 @@ def run_migration_with_reboot(test, params, env):
try:
# Reboot the VM in the background
- bg = kvm_utils.Thread(kvm_test_utils.reboot, (vm, session))
+ bg = kvm_utils.Thread(vm.reboot, (session,))
bg.start()
try:
while bg.is_alive():
@@ -47,7 +47,7 @@ def run_timedrift_with_reboot(test, params, env):
# Run current iteration
logging.info("Rebooting: iteration %d of %d..." %
(i + 1, reboot_iterations))
- session = kvm_test_utils.reboot(vm, session)
+ session = vm.reboot(session)
# Get time after current iteration
(ht1_, gt1_) = kvm_test_utils.get_time(session, time_command,
time_filter_re, time_format)
@@ -1156,7 +1156,7 @@ def run_virtio_console(test, params, env):
logging.error("Virtio-console driver is irreparably"
" blocked. Every comd end with sig KILL."
"Try reboot vm for continue in testing.")
- vm[1] = kvm_test_utils.reboot(vm[0], vm[1], "system_reset")
+ vm[1] = vm[0].reboot(vm[1], "system_reset")
init_guest(vm, consoles)
(match, data) = _on_guest("virt.clean_port('%s'),1024" %
consoles[0][0].name, vm, 2)
@@ -99,7 +99,7 @@ def run_whql_client_install(test, params, env):
session.cmd(cmd, timeout=300)
# Reboot
- session = kvm_test_utils.reboot(vm, session)
+ session = vm.reboot(session)
# Access shared resources on the server machine
logging.info("Attempting to access remote share on server")
@@ -132,5 +132,5 @@ def run_whql_client_install(test, params, env):
session.cmd(cmd % ("DefaultPassword", client_password))
# Reboot one more time
- session = kvm_test_utils.reboot(vm, session)
+ session = vm.reboot(session)
session.close()
@@ -74,7 +74,7 @@ def run_whql_submission(test, params, env):
server_session.cmd(cmd, print_func=logging.debug)
# Reboot the client machines
- sessions = kvm_utils.parallel((kvm_test_utils.reboot, (vm, session))
+ sessions = kvm_utils.parallel((vm.reboot, (session,))
for vm, session in zip(vms, sessions))
# Check the NICs again