Index: client/tests/kvm/tests/ioquit.py |
diff --git a/client/tests/kvm/tests/ioquit.py b/client/tests/kvm/tests/ioquit.py |
index 81261393bf4d0c681e0e9cb3589de7c84c85d696..34b4fb585d983f02b5a87e55de3d99b52819ec2d 100644 |
--- a/client/tests/kvm/tests/ioquit.py |
+++ b/client/tests/kvm/tests/ioquit.py |
@@ -1,6 +1,4 @@ |
import logging, time, random |
-from autotest_lib.client.common_lib import error |
-import kvm_test_utils |
def run_ioquit(test, params, env): |
@@ -11,26 +9,21 @@ def run_ioquit(test, params, env): |
@param params: Dictionary with the test parameters. |
@param env: Dictionary with test environment. |
""" |
- |
- vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) |
- session = kvm_test_utils.wait_for_login(vm, |
- timeout=int(params.get("login_timeout", 360))) |
- session2 = kvm_test_utils.wait_for_login(vm, |
- timeout=int(params.get("login_timeout", 360))) |
+ vm = env.get_vm(params["main_vm"]) |
+ vm.verify_alive() |
+ login_timeout = int(params.get("login_timeout", 360)) |
+ session = vm.wait_for_login(timeout=login_timeout) |
+ session2 = vm.wait_for_login(timeout=login_timeout) |
try: |
bg_cmd = params.get("background_cmd") |
logging.info("Add IO workload for guest OS.") |
- (s, o) = session.get_command_status_output(bg_cmd, timeout=60) |
+ session.cmd_output(bg_cmd, timeout=60) |
check_cmd = params.get("check_cmd") |
- (s, o) = session2.get_command_status_output(check_cmd, timeout=60) |
- if s: |
- raise error.TestError("Fail to add IO workload for Guest OS") |
+ session2.cmd(check_cmd, timeout=60) |
logging.info("Sleep for a while") |
- time.sleep(random.randrange(30,100)) |
- (s, o) = session2.get_command_status_output(check_cmd, timeout=60) |
- if s: |
- logging.info("IO workload finished before the VM was killed") |
+ time.sleep(random.randrange(30, 100)) |
+ session2.cmd(check_cmd, timeout=60) |
logging.info("Kill the virtual machine") |
vm.process.close() |
finally: |