[Libvirt-cim] [PATCH] [TEST] Add test for verifying disabled RequestStateChange()

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Aug 10 23:44:59 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1249668560 25200
# Node ID 9f740b6fe6cfe41317514182f245d1eb9938122c
# Parent  12fd8bac01f25251dbfb64dd5e764f533108964b
[TEST] Add test for verifying disabled RequestStateChange()

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 12fd8bac01f2 -r 9f740b6fe6cf suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py	Fri Aug 07 11:09:20 2009 -0700
@@ -0,0 +1,74 @@
+#!/usr/bin/python
+#
+# Copyright 2009 IBM Corp.
+#
+# Authors:
+#    Kaitlin Rupert <karupert at us.ibm.com>
+#
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Test Case Info:
+# --------------
+# This test case is used to verify the Virtual System State Transition
+# information is captured in the RequestedState Property of the VS.
+# The test is considered to be successful if RequestedState Property
+# has a value of 3 when the VS is moved from active state to a disabled state.
+#
+# Date: 08-07-2009
+
+import sys
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+from XenKvmLib.vxml import get_class
+
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+
+default_dom = 'cs_test_domain'
+
+ at do_main(sup_types)
+def main():
+    options = main.options
+    status = FAIL
+    server = options.ip
+    virt   = options.virt
+
+    try:
+        # define the vs
+        cxml = get_class(virt)(default_dom)
+        ret = cxml.cim_define(server)
+        if not ret:
+            raise Exception("Failed to define the guest: %s" % default_dom)
+
+        status = cxml.cim_start(server)
+        if status != PASS:
+            raise Exception("Unable start dom '%s'" % default_dom)
+
+        status = cxml.cim_disable(server)
+        if status != PASS:
+            raise Exception("Unable disable dom '%s'" % default_dom)
+
+    except Exception, detail:
+        logger.error("Exception: %s", detail)
+        status = FAIL
+
+    cxml.cim_destroy(server)
+    cxml.undefine(server)
+
+    return status
+
+if __name__ == "__main__":
+    sys.exit(main())




More information about the Libvirt-cim mailing list