# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223963331 25200
# Node ID 6c71a150e47018258ca2abfa035891717c955995
# Parent c7eaf17bd591f313b93ff2b2087cee11b25789e0
[TEST] #2 A big patch of update tc to call new EnumInstances
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c7eaf17bd591 -r 6c71a150e470
suites/libvirt-cim/cimtest/EnabledLogicalElementCapabilities/01_enum.py
--- a/suites/libvirt-cim/cimtest/EnabledLogicalElementCapabilities/01_enum.py Fri Oct 10
03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/EnabledLogicalElementCapabilities/01_enum.py Mon Oct 13
22:48:51 2008 -0700
@@ -36,14 +36,11 @@ def main():
options = main.options
try:
- key_list = ["InstanceID"]
- elec = enumclass.enumerate(options.ip,
- "EnabledLogicalElementCapabilities",
- key_list,
- options.virt)
+ elec_class = get_typed_class(options.virt,
+ "EnabledLogicalElementCapabilities")
+ elec = enumclass.EnumInstances(options.ip, elec_class)
except Exception:
- Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, \
- get_typed_class(options.virt,
'EnabledLogicalElementCapabilities'))
+ Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, elec_class)
return 1
diff -r c7eaf17bd591 -r 6c71a150e470 suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Fri Oct 10 03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Mon Oct 13 22:48:51 2008 -0700
@@ -48,7 +48,7 @@ def main():
ret, linux_cs = check_sblim(options.ip, options.virt)
try:
- hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
+ hs = enumclass.EnumInstances(options.ip, name)
except Exception, details:
logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
status = FAIL
diff -r c7eaf17bd591 -r 6c71a150e470
suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py
--- a/suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py Fri Oct 10
03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py Mon Oct 13
22:48:51 2008 -0700
@@ -87,8 +87,7 @@ def get_proflist():
proflist = []
status = PASS
try:
- key_list = ["InstanceID"]
- proflist = enumclass.enumerate(server, reg_classname, key_list, virt)
+ proflist = enumclass.EnumInstances(server, reg_classname)
if len(proflist) < 5:
logger.error("%s returned %i %s objects, expected atleast 5",
reg_classname, len(proflist), 'Profile')
diff -r c7eaf17bd591 -r 6c71a150e470
suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py
--- a/suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py Fri Oct 10
03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py Mon Oct 13
22:48:51 2008 -0700
@@ -80,8 +80,7 @@ def get_proflist():
proflist = []
status = PASS
try:
- key_list = ["InstanceID"]
- proflist = enumclass.enumerate(server, reg_classname, key_list, virt)
+ proflist = enumclass.EnumInstances(server, reg_classname)
if len(proflist) < 5 :
logger.error("%s returned %i %s objects, expected atleast 5",
reg_classname, len(proflist),
'Profile')
diff -r c7eaf17bd591 -r 6c71a150e470
suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py Fri Oct 10
03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py Mon Oct 13
22:48:51 2008 -0700
@@ -111,7 +111,7 @@ def get_netrasd_instid(server, virt, vsx
rasd_list = []
status = PASS
try:
- rasd_list = enumclass.enumerate_inst(server, classname, virt)
+ rasd_list = enumclass.EnumNames(server, classname)
if len(rasd_list) < 1:
logger.error("%s returned %i instances, excepted atleast 1 "
"instance", classname, len(rasd_list))
diff -r c7eaf17bd591 -r 6c71a150e470 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Fri Oct 10 03:08:12 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Mon Oct 13 22:48:51 2008 -0700
@@ -27,7 +27,7 @@ import sys
import sys
import os
from distutils.file_util import move_file
-from XenKvmLib.enumclass import enumerate
+from XenKvmLib.enumclass import EnumInstances
from XenKvmLib.classes import get_typed_class
from XenKvmLib import vxml
from CimTest import Globals
@@ -111,36 +111,39 @@ def main():
logger.error("Failed to initialise the list")
return status
- key_list = ["InstanceID"]
+ mp = get_typed_class(virt, mp_cn)
+ pp = get_typed_class(virt, pp_cn)
+ dp = get_typed_class(virt, dp_cn)
+ np = get_typed_class(virt, np_cn)
+
+ try:
+ mempool = EnumInstances(ip, mp)
+ except Exception:
+ logger.error(Globals.CIM_ERROR_ENUMERATE % mp)
+ return FAIL
+ status = verify_fields(pool_list, mempool, mp)
try:
- mempool = enumerate(ip, mp_cn, key_list, virt)
+ propool = EnumInstances(ip, pp)
except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % mp_cn)
+ logger.error(Globals.CIM_ERROR_ENUMERATE % pp)
return FAIL
- status = verify_fields(pool_list, mempool, get_typed_class(virt, mp_cn))
-
- try:
- propool = enumerate(ip, pp_cn, key_list, virt)
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % pp_cn)
- return FAIL
- status = verify_fields(pool_list, propool, get_typed_class(virt, pp_cn))
+ status = verify_fields(pool_list, propool, pp)
if virt != 'LXC':
try:
- diskpool = enumerate(ip, dp_cn, key_list, virt)
+ diskpool = EnumInstances(ip, dp)
except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % dp_cn)
+ logger.error(Globals.CIM_ERROR_ENUMERATE % dp)
return FAIL
- status = verify_fields(pool_list, diskpool, get_typed_class(virt, dp_cn))
+ status = verify_fields(pool_list, diskpool, dp)
try:
- netpool = enumerate(ip, np_cn, key_list, virt)
+ netpool = EnumInstances(ip, np)
except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % np_cn)
+ logger.error(Globals.CIM_ERROR_ENUMERATE % np)
return FAIL
- status = verify_fields(pool_list, netpool, get_typed_class(virt, np_cn))
+ status = verify_fields(pool_list, netpool, np)
return status