virt.virt_test_utils: run_autotest - 'tar' needs relative paths to strip the leading '/'
[autotest-zwu.git] / client / virt / tests / boot.py
blob4fabcd5c2962ae53101c8687629aede4b4564f93
1 import time
4 def run_boot(test, params, env):
5 """
6 KVM reboot test:
7 1) Log into a guest
8 2) Send a reboot command or a system_reset monitor command (optional)
9 3) Wait until the guest is up again
10 4) Log into the guest to verify it's up again
12 @param test: kvm test object
13 @param params: Dictionary with the test parameters
14 @param env: Dictionary with test environment.
15 """
16 vm = env.get_vm(params["main_vm"])
17 vm.verify_alive()
18 timeout = float(params.get("login_timeout", 240))
19 session = vm.wait_for_login(timeout=timeout)
21 if params.get("reboot_method"):
22 if params["reboot_method"] == "system_reset":
23 time.sleep(int(params.get("sleep_before_reset", 10)))
24 session = vm.reboot(session, params["reboot_method"], 0, timeout)
26 session.close()