Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
Show replies by date
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1206687269 25200
# Node ID 9ae9d9c26a3024f02c8837ba0bca023385ab5c3d
# Parent c9bb4d898469450c851139d5faa58a5818835e08
[TEST] modified enmuclass lib support virt argument
Meanwhile, adapt to the current format
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r c9bb4d898469 -r 9ae9d9c26a30 suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Thu Mar 27 11:07:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Thu Mar 27 23:54:29 2008 -0700
@@ -215,7 +215,13 @@ class KVM_DiskResourceAllocationSettingD
# ex: Xen_RegisteredProfile
# keyname = The keyvalue
# ex: InstanceID in case of Xen_RegisteredProfile
-def enumerate_inst(server, classname):
+def enumerate_inst(server, classname, virt="Xen"):
+ classname = "%s" % classname
+ new_classname = classname.split('_')
+ if len(new_classname) == 2:
+ classname = classname[1]
+
+ classname = eval(get_typed_class(virt, classname))
instances = []
conn = pywbem.WBEMConnection('http://%s' % server,
(Globals.CIM_USER, Globals.CIM_PASS),
GY> # HG changeset patch
GY> # User Guolian Yun <yunguol(a)cn.ibm.com>
GY> # Date 1206687269 25200
GY> # Node ID 9ae9d9c26a3024f02c8837ba0bca023385ab5c3d
GY> # Parent c9bb4d898469450c851139d5faa58a5818835e08
GY> [TEST] modified enmuclass lib support virt argument
GY> Meanwhile, adapt to the current format
So are you saying that the split() on "_" is temporary?
GY> + new_classname = classname.split('_')
GY> + if len(new_classname) == 2:
GY> + classname = classname[1]
Even if it is temporary, this should be:
new_classname = classname.split("_", 1)
so that you don't have to check the length.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1206687608 25200
# Node ID 8a41117ff62a63324dcb8b7036602368c9693ecc
# Parent 9ae9d9c26a3024f02c8837ba0bca023385ab5c3d
[TEST] update VSMC.01 test case for XenFV and KVM support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 9ae9d9c26a30 -r 8a41117ff62a
suites/libvirt-cim/cimtest/VirtualSystemMigrationCapabilities/01_enum.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationCapabilities/01_enum.py Thu Mar 27
23:54:29 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationCapabilities/01_enum.py Fri Mar 28
00:00:08 2008 -0700
@@ -24,10 +24,11 @@
import sys
from XenKvmLib import enumclass
+from XenKvmLib.classes import get_typed_class
from CimTest.Globals import log_param, CIM_ERROR_ENUMERATE, logger, do_main
from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen']
+sup_types = ['Xen', 'XenFV', 'KVM']
def print_error(fieldname, ret_value, exp_value):
logger.error("%s Mismatch", fieldname)
@@ -39,12 +40,13 @@ def main():
log_param()
# Expected values from the enumetation
- cn = 'Xen_VirtualSystemMigrationCapabilities'
+ cn = get_typed_class(options.virt, 'VirtualSystemMigrationCapabilities')
instid = 'MigrationCapabilities'
try:
vsmc = enumclass.enumerate_inst(options.ip,
-
enumclass.Xen_VirtualSystemMigrationCapabilities)
+ "VirtualSystemMigrationCapabilities",
+ options.virt)
except Exception:
logger.error(CIM_ERROR_ENUMERATE, cn)
return FAIL
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1206687821 25200
# Node ID 2507972be4b50c6f618d4a1d6a1ebea9084048da
# Parent 8a41117ff62a63324dcb8b7036602368c9693ecc
[TEST] update VSMC.02 for XenFV and KVM support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 8a41117ff62a -r 2507972be4b5
suites/libvirt-cim/cimtest/VirtualSystemMigrationCapabilities/02_vsmc_gi_errs.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationCapabilities/02_vsmc_gi_errs.py Fri
Mar 28 00:00:08 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationCapabilities/02_vsmc_gi_errs.py Fri
Mar 28 00:03:41 2008 -0700
@@ -4,7 +4,7 @@
#
# Authors:
# Deepti B. Kalakeri<dkalaker(a)in.ibm.com>
-#
+# Guolian Yun <yunguol(a)cn.ibm.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
@@ -52,8 +52,9 @@ from CimTest.Globals import do_main
from CimTest.Globals import do_main
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.common_util import try_getinstance
+from XenKvmLib.classes import get_typed_class
-sup_types = ['Xen']
+sup_types = ['Xen', 'XenFV', 'KVM']
expr_values = {
"invalid_instid" : { 'rc' :
pywbem.CIM_ERR_NOT_FOUND, \
@@ -67,7 +68,7 @@ def main():
log_param()
status = PASS
conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS),
CIM_NS)
- classname = 'Xen_VirtualSystemMigrationCapabilities'
+ classname = get_typed_class(options.virt,
'VirtualSystemMigrationCapabilities')
field = 'INVALID_Instid_KeyName'
keys = { field : "RPCC" }
Guo Lian Yun wrote:
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
+1 for this bundle.
--
- Zhengang