diff mbox

[Autotest,2/2] KVM-test: subtest guest_s4: Add check of if there's enough space left for S4

Message ID 1263364323-16506-2-git-send-email-yzhou@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yolkfull Chow Jan. 13, 2010, 6:32 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/tests/guest_s4.py b/client/tests/kvm/tests/guest_s4.py
index 82572f6..a289148 100644
--- a/client/tests/kvm/tests/guest_s4.py
+++ b/client/tests/kvm/tests/guest_s4.py
@@ -15,11 +15,11 @@  def run_guest_s4(test, params, env):
     session = kvm_test_utils.wait_for_login(vm)
 
     logging.info("Checking whether guest OS supports suspend to disk (S4)...")
-    status = session.get_command_status(params.get("check_s4_support_cmd"))
-    if status is None:
-        logging.error("Failed to check if guest OS supports S4")
-    elif status != 0:
-        raise error.TestFail("Guest OS does not support S4")
+    s, o = session.get_command_status_output(params.get("check_s4_support_cmd"))
+    if "not enough space" in o:
+        raise error.TestError("Check S4 support failed: %s" % o)
+    elif s != 0:
+        raise error.TestNAError("Guest OS does not support S4")
 
     logging.info("Waiting until all guest OS services are fully started...")
     time.sleep(float(params.get("services_up_timeout", 30)))