# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223884738 25200
# Node ID 4cfe13e4605c2252569ac4d76d6453f586f273ce
# Parent c7eaf17bd591f313b93ff2b2087cee11b25789e0
[TEST] Modify EC 01_forward.py&02_reverse.py to use new EnumInstances call
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c7eaf17bd591 -r 4cfe13e4605c
suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Fri Oct 10 03:08:12 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Mon Oct 13 00:58:58 2008
-0700
@@ -49,7 +49,7 @@
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
-from XenKvmLib.enumclass import enumerate
+from XenKvmLib.enumclass import EnumInstances
from XenKvmLib.const import default_network_name, default_pool_name
@@ -139,8 +139,7 @@
profiles_instid_list = []
status = PASS
try:
- key_list = ["InstanceID"]
- proflist = enumerate(server, reg_classname, key_list, virt)
+ proflist = EnumInstances(server, reg_classname)
if len(proflist) < 7:
logger.error("'%s' returned '%d' '%s' objects,
expected atleast 7",
reg_classname, len(proflist), 'Profile')
diff -r c7eaf17bd591 -r 4cfe13e4605c
suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Fri Oct 10 03:08:12 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Mon Oct 13 00:58:58 2008
-0700
@@ -43,7 +43,6 @@
from CimTest import Globals
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS
from XenKvmLib.const import do_main
-from XenKvmLib import enumclass
from XenKvmLib import assoc
from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.test_doms import destroy_and_undefine_all
@@ -104,10 +103,10 @@
return FAIL
inst_list.append(sys)
- keys = ['Name', 'CreationClassName']
try:
#Getting the hostname, to verify with the value returned by the assoc.
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)
+ hs = get_typed_class(options.virt, 'HostSystem')
+ host_sys = enumclass.EnumInstances(options.ip, hs)
if len(host_sys) < 1:
logger.error("ERROR: Enumerate returned 0 host instances")
@@ -123,14 +122,10 @@
Globals.CIM_NS = 'root/interop'
try:
- key_list = ["InstanceID"]
- proflist = enumclass.enumerate(options.ip,
- "RegisteredProfile",
- key_list,
- options.virt)
+ profile_cn = get_typed_class(options.virt, "RegisteredProfile")
+ proflist = enumclass.EnumInstances(options.ip, profile_cn)
except Exception, details:
- logger.error(CIM_ERROR_ENUMERATE,
- get_typed_class(options.virt, 'RegisteredProfile'))
+ logger.error(CIM_ERROR_ENUMERATE, profile_cn)
logger.error("Exception: %s", details)
return status