| Index: client/tests/kvm/tests/linux_s3.py
|
| diff --git a/client/tests/kvm/tests/linux_s3.py b/client/tests/kvm/tests/linux_s3.py
|
| index 4a782b82fb225cf5ae3a575fdc7b0b186d3707bd..5a04fca0c83da899286093431288510cb57dff82 100644
|
| --- a/client/tests/kvm/tests/linux_s3.py
|
| +++ b/client/tests/kvm/tests/linux_s3.py
|
| @@ -1,6 +1,5 @@
|
| import logging, time
|
| from autotest_lib.client.common_lib import error
|
| -import kvm_test_utils
|
|
|
|
|
| def run_linux_s3(test, params, env):
|
| @@ -11,23 +10,20 @@ def run_linux_s3(test, params, env):
|
| @param params: Dictionary with test parameters.
|
| @param env: Dictionary with the test environment.
|
| """
|
| - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
|
| + vm = env.get_vm(params["main_vm"])
|
| + vm.verify_alive()
|
| timeout = int(params.get("login_timeout", 360))
|
| - session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
|
| + session = vm.wait_for_login(timeout=timeout)
|
|
|
| logging.info("Checking that VM supports S3")
|
| - status = session.get_command_status("grep -q mem /sys/power/state")
|
| - if status == None:
|
| - logging.error("Failed to check if S3 exists")
|
| - elif status != 0:
|
| - raise error.TestFail("Guest does not support S3")
|
| + session.cmd("grep -q mem /sys/power/state")
|
|
|
| logging.info("Waiting for a while for X to start")
|
| time.sleep(10)
|
|
|
| - src_tty = session.get_command_output("fgconsole").strip()
|
| - logging.info("Current virtual terminal is %s" % src_tty)
|
| - if src_tty not in map(str, range(1,10)):
|
| + src_tty = session.cmd_output("fgconsole").strip()
|
| + logging.info("Current virtual terminal is %s", src_tty)
|
| + if src_tty not in map(str, range(1, 10)):
|
| raise error.TestFail("Got a strange current vt (%s)" % src_tty)
|
|
|
| dst_tty = "1"
|
| @@ -38,9 +34,7 @@ def run_linux_s3(test, params, env):
|
| command = "chvt %s && echo mem > /sys/power/state && chvt %s" % (dst_tty,
|
| src_tty)
|
| suspend_timeout = 120 + int(params.get("smp")) * 60
|
| - status = session.get_command_status(command, timeout=suspend_timeout)
|
| - if status != 0:
|
| - raise error.TestFail("Suspend to mem failed")
|
| + session.cmd(command, timeout=suspend_timeout)
|
|
|
| logging.info("VM resumed after S3")
|
|
|
|
|