[Libvirt-cim] [PATCH] [TEST] Update ComputerSystem.01, 02, 03&05 to call new Enum* and GetInstance

yunguol at cn.ibm.com yunguol at cn.ibm.com
Mon Oct 13 08:45:57 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1223887550 25200
# Node ID 6c36af362f520ca37f8440a78f850520d6758dcf
# Parent  c7eaf17bd591f313b93ff2b2087cee11b25789e0
[TEST] Update ComputerSystem.01,02,03&05 to call new Enum* and GetInstance

Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>

diff -r c7eaf17bd591 -r 6c36af362f52 suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py	Fri Oct 10 03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py	Mon Oct 13 01:45:50 2008 -0700
@@ -26,6 +26,7 @@
 from XenKvmLib.const import do_main
 from XenKvmLib import enumclass
 from VirtLib import live
+from XenKvmLib.classes import get_typed_class
 from VirtLib import utils
 from CimTest import Globals
 from CimTest.ReturnCodes import PASS, FAIL
@@ -37,9 +38,9 @@
     options = main.options 
     status = PASS
 
-    keys = ['Name', 'CreationClassName']
+    cs_class = get_typed_class(options.virt, 'ComputerSystem')
     try:
-        cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys, options.virt)
+        cs = enumclass.EnumInstances(options.ip, cs_class)
         live_cs = live.domain_list(options.ip, options.virt)
         for system in cs:
             name = system.name
diff -r c7eaf17bd591 -r 6c36af362f52 suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py	Fri Oct 10 03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py	Mon Oct 13 01:45:50 2008 -0700
@@ -27,6 +27,7 @@
 from XenKvmLib import enumclass
 from VirtLib import live
 from VirtLib import utils
+from XenKvmLib.classes import get_typed_class
 from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
 from XenKvmLib.const import do_main
 from CimTest.ReturnCodes import PASS, FAIL, SKIP
@@ -48,11 +49,10 @@
         logger.error("System has defined domains; unable to run")
         return SKIP 
 
-    cn = "%s_ComputerSystem" % options.virt
+    cn = get_typed_class(options.virt, 'ComputerSystem')
 
-    keys = ['Name', 'CreationClassName']
     try:
-        cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys, options.virt)
+        cs = enumclass.EnumInstances(options.ip, cn)
 
     except Exception, details:
         logger.error(CIM_ERROR_ENUMERATE, cn)
diff -r c7eaf17bd591 -r 6c36af362f52 suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py	Fri Oct 10 03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py	Mon Oct 13 01:45:50 2008 -0700
@@ -49,9 +49,9 @@
         Globals.logger.error(VIRSH_ERROR_DEFINE % test_dom)
         return status
 
-    keys = ['Name', 'CreationClassName']
+    cs_class = get_typed_class(options.virt, 'ComputerSystem')
     try:
-        cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys, options.virt)
+        cs = enumclass.EnumInstances(options.ip, cs_class)
         if len(cs) == 0:
             raise Exception('No cs instance returned')
         for dom in cs:
diff -r c7eaf17bd591 -r 6c36af362f52 suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py	Fri Oct 10 03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py	Mon Oct 13 01:45:50 2008 -0700
@@ -78,7 +78,8 @@
                 'Name' : test_dom,
                 'CreationClassName' : get_typed_class(options.virt, 'ComputerSystem')
                }
-        cs = enumclass.getInstance(options.ip, 'ComputerSystem', keys, options.virt)
+        cs_class = get_typed_class(options.virt, 'ComputerSystem')
+        cs = enumclass.GetInstance(options.ip, cs_class, keys)
 
         if cs.Name == test_dom:
             from_State =  cs.EnabledState
@@ -101,7 +102,7 @@
 
 #Get the value of the EnabledState property and RequestedState property.
     try:
-        cs= enumclass.getInstance(options.ip, 'ComputerSystem', keys, options.virt)
+        cs= enumclass.GetInstance(options.ip, cs_class, keys)
         if cs.Name == test_dom:
             to_RequestedState = cs.RequestedState
             enabledState = cs.EnabledState




More information about the Libvirt-cim mailing list