# HG changeset patch
# User Guolian Yun <yunguol(a)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(a)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):