| OLD | NEW |
| 1 import time | 1 import time |
| 2 | 2 |
| 3 | 3 |
| 4 def run_boot(test, params, env): | 4 def run_boot(test, params, env): |
| 5 """ | 5 """ |
| 6 KVM reboot test: | 6 KVM reboot test: |
| 7 1) Log into a guest | 7 1) Log into a guest |
| 8 2) Send a reboot command or a system_reset monitor command (optional) | 8 2) Send a reboot command or a system_reset monitor command (optional) |
| 9 3) Wait until the guest is up again | 9 3) Wait until the guest is up again |
| 10 4) Log into the guest to verify it's up again | 10 4) Log into the guest to verify it's up again |
| 11 | 11 |
| 12 @param test: kvm test object | 12 @param test: kvm test object |
| 13 @param params: Dictionary with the test parameters | 13 @param params: Dictionary with the test parameters |
| 14 @param env: Dictionary with test environment. | 14 @param env: Dictionary with test environment. |
| 15 """ | 15 """ |
| 16 vm = env.get_vm(params["main_vm"]) | 16 vm = env.get_vm(params["main_vm"]) |
| 17 vm.verify_alive() | 17 vm.verify_alive() |
| 18 timeout = float(params.get("login_timeout", 240)) | 18 timeout = float(params.get("login_timeout", 240)) |
| 19 session = vm.wait_for_login(timeout=timeout) | 19 session = vm.wait_for_login(timeout=timeout) |
| 20 | 20 |
| 21 if params.get("reboot_method"): | 21 if params.get("reboot_method"): |
| 22 if params["reboot_method"] == "system_reset": | 22 if params["reboot_method"] == "system_reset": |
| 23 time.sleep(int(params.get("sleep_before_reset", 10))) | 23 time.sleep(int(params.get("sleep_before_reset", 10))) |
| 24 session = vm.reboot(session, params["reboot_method"], 0, timeout) | 24 session = vm.reboot(session, params["reboot_method"], 0, timeout) |
| 25 | 25 |
| 26 session.close() | 26 session.close() |
| OLD | NEW |