# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223964411 25200
# Node ID c64cbf3068d46c66fd9ce425bf4621e67765399b
# Parent c7eaf17bd591f313b93ff2b2087cee11b25789e0
[TEST] #2 Update ComputerSystem.01, 02, 03 to call new Enum* and GetInstance
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c7eaf17bd591 -r c64cbf3068d4 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 23:06:51 2008 -0700
@@ -26,6 +26,7 @@ from XenKvmLib.const import do_main
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 @@ def main():
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 c64cbf3068d4
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 23:06:51 2008
-0700
@@ -27,6 +27,7 @@ from XenKvmLib import enumclass
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 @@ def main():
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 c64cbf3068d4
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 23:06:51 2008
-0700
@@ -49,9 +49,9 @@ def main():
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: