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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If disk has no enough space left, check S4 support will fail.

Also use 'TestNAError' as error type if guest really doesn't support S4.
(Thanks Jason for pointing this out. :)

Signed-off-by: Yolkfull Chow <yzhou@xxxxxxxxxx>
---
 client/tests/kvm/tests/guest_s4.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

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)))
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux