yunguol(a)cn.ibm.com wrote:
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223890466 25200
# Node ID 813f4dc8b30ef3a6903b4ba87d585325a8cdd1cb
# Parent c7eaf17bd591f313b93ff2b2087cee11b25789e0
[TEST] A big patch of update tc to call new EnumInstances
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c7eaf17bd591 -r 813f4dc8b30e
suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Fri Oct 10 03:08:12
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Mon Oct 13 02:34:26
2008 -0700
@@ -38,8 +38,7 @@
bug_sblim = "00007"
def append_to_list(server, virt, poolname, valid_elc_id):
- keys_list = ['InstanceID']
- pool_list = enumerate(server, poolname, keys_list, virt)
+ pool_list = EnumInstances(server, poolname)
if len(pool_list) > 0:
for pool in pool_list:
valid_elc_id.append(pool.InstanceID)
This test fails with the following error:
ElementCapabilities - 01_forward.py: FAIL
ERROR - Exception: In fn set_pool_info(): global name 'EnumInstances'
is not defined
CIM_ERR_INVALID_CLASS: Linux_ComputerSystem
diff -r c7eaf17bd591 -r 813f4dc8b30e
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
02:34:26 2008 -0700
@@ -36,14 +36,11 @@
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
+1 for me.
diff -r c7eaf17bd591 -r 813f4dc8b30e
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 02:34:26 2008 -0700
@@ -48,7 +48,7 @@
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
+1 for me.
diff -r c7eaf17bd591 -r 813f4dc8b30e
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
02:34:26 2008 -0700
@@ -87,8 +87,7 @@
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')
+1 for me
diff -r c7eaf17bd591 -r 813f4dc8b30e
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
02:34:26 2008 -0700
@@ -80,8 +80,7 @@
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')
+1 for me.
diff -r c7eaf17bd591 -r 813f4dc8b30e
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
02:34:26 2008 -0700
@@ -111,7 +111,7 @@
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))
+1 for me.
diff -r c7eaf17bd591 -r 813f4dc8b30e
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 02:34:26 2008 -0700
@@ -27,7 +27,7 @@
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 @@
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
+1 for me.
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim