[PATCH] [TEST] #2 Add branch of err code to RPCS/04

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1238563807 25200 # Node ID e30fda741dc70e6fabefe18eb33eb383ebff7e7e # Parent bfd8818c151aec7e9fa8a675fe29e03e4e07824e [TEST] #2 Add branch of err code to RPCS/04 Updates from 1 to 2: Assign pywbem.CIM_ERR_INVALID_PARAMETER instead of numeric value to cim_errno Tested for KVM, Xen with current sources and rpm Signed-off-by: Guolian Yun<yunguol@cn.ibm.com> diff -r bfd8818c151a -r e30fda741dc7 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Sun Mar 29 16:04:03 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Tue Mar 31 22:30:07 2009 -0700 @@ -52,17 +52,22 @@ from XenKvmLib import rpcs_service from CimTest.Globals import logger from CimTest.ReturnCodes import FAIL, PASS -from XenKvmLib.const import do_main, platform_sup +from XenKvmLib.const import do_main, platform_sup, get_provider_version from XenKvmLib.classes import get_typed_class -cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED cim_mname = "CreateChildResourcePool" +libvirt_cim_child_pool_rev = 837 @do_main(platform_sup) def main(): options = main.options rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \ "ResourcePoolConfigurationService"))(options.ip) + curr_cim_rev, changeset = get_provider_version(options.virt, options.ip) + if curr_cim_rev >= libvirt_cim_child_pool_rev: + cim_errno = pywbem.CIM_ERR_INVALID_PARAMETER + else: + cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED try: rpcs_conn.CreateChildResourcePool() except pywbem.CIMError, (err_no, desc):

+1 for me. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik@linux.vnet.ibm.com

rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \ "ResourcePoolConfigurationService"))(options.ip) + curr_cim_rev, changeset = get_provider_version(options.virt, options.ip) + if curr_cim_rev >= libvirt_cim_child_pool_rev: + cim_errno = pywbem.CIM_ERR_INVALID_PARAMETER + else: + cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED try: rpcs_conn.CreateChildResourcePool() except pywbem.CIMError, (err_no, desc):
Sorry Daisy, I didn't have a chance to look at the first revision. Agreed - you need to branch this test. However, this method is now supported. So, for libvirt-cim >= 837, this test should attempt to create network pool and verify that network pool is created. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

libvirt-cim-bounces@redhat.com wrote on 2009-04-02 08:24:52:
rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt,
"ResourcePoolConfigurationService"))(options.ip) + curr_cim_rev, changeset = get_provider_version(options.virt,
\ options.ip)
+ if curr_cim_rev >= libvirt_cim_child_pool_rev: + cim_errno = pywbem.CIM_ERR_INVALID_PARAMETER + else: + cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED try: rpcs_conn.CreateChildResourcePool() except pywbem.CIMError, (err_no, desc):
Sorry Daisy, I didn't have a chance to look at the first revision.
Agreed - you need to branch this test. However, this method is now supported. So, for libvirt-cim >= 837, this test should attempt to create network pool and verify that network pool is created.
I will work it out on the next patch =)
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

libvirt-cim-bounces@redhat.com wrote on 2009-04-02 08:24:52:
rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt,
"ResourcePoolConfigurationService"))(options.ip) + curr_cim_rev, changeset = get_provider_version(options.virt,
\ options.ip)
+ if curr_cim_rev >= libvirt_cim_child_pool_rev: + cim_errno = pywbem.CIM_ERR_INVALID_PARAMETER + else: + cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED try: rpcs_conn.CreateChildResourcePool() except pywbem.CIMError, (err_no, desc):
Sorry Daisy, I didn't have a chance to look at the first revision.
Agreed - you need to branch this test. However, this method is now supported. So, for libvirt-cim >= 837, this test should attempt to create network pool and verify that network pool is created.
There are three arguments in CreateChildResourcePool: ElementName, Settings and ParentPool. What's the ParentPool on cimtest? Do I have to create a primordial pool at first? One more thing, the provider only support create networkpool now, right? Thanks!
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
participants (4)
-
Deepti B Kalakeri
-
Guo Lian Yun
-
Kaitlin Rupert
-
yunguol@cn.ibm.com