# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1236912499 25200
# Node ID 6e1a1d69588b34117d087a3f8c9e8dbc50618f9b
# Parent 676a8b05baa09b69052d519c7b438b301bea849c
[TEST] Fix VirtualSystemManagementService/05_destroysystem_neg.py with provider's
updates of error message
Tested for KVM with current sources and rpm
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r 676a8b05baa0 -r 6e1a1d69588b
suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py
---
a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Tue
Mar 10 22:27:59 2009 -0700
+++
b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Thu
Mar 12 19:48:19 2009 -0700
@@ -29,16 +29,18 @@
from XenKvmLib.classes import get_typed_class
from XenKvmLib.test_doms import undefine_test_domain
from CimTest.Globals import logger
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import FAIL, PASS, SKIP
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
vsms_status_version = 534
+vsms_err_message = 814
def destroysystem_fail(tc, options):
service = vsms.get_vsms_class(options.virt)(options.ip)
classname = get_typed_class(options.virt, 'ComputerSystem')
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
if tc == 'noname':
cs_ref = CIMInstanceName(classname,
@@ -47,6 +49,10 @@
exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
'desc' : 'Unable to retrieve domain name.'
}
+ if curr_cim_rev >= vsms_err_message:
+ exp_value = { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'Unable to retrieve domain name: Error
0'
+ }
elif tc == 'nonexistent':
cs_ref = CIMInstanceName(classname,keybindings = {
@@ -56,6 +62,10 @@
exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
'desc' : 'Failed to find domain'
}
+ if curr_cim_rev >= vsms_err_message:
+ exp_value = { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "Referenced domain
`##@@!!cimtest_domain'" \
+ " does not exist: Domain not found"}
else:
return SKIP
@@ -68,7 +78,7 @@
err_no = details[0]
err_desc = details[1]
if err_no == exp_value['rc'] and err_desc.find(exp_value['desc'])
>= 0:
- logger.error("For Invalid Scenario '%s'", tc)
+ logger.info("For Invalid Scenario '%s'", tc)
logger.info('Got expected error no: %s', err_no)
logger.info('Got expected error desc: %s',err_desc)
return PASS
@@ -82,7 +92,7 @@
options = main.options
rc1 = destroysystem_fail('noname', options)
rc2 = destroysystem_fail('nonexistent', options)
-
+
status = FAIL
if rc1 == PASS and rc2 == PASS:
status = PASS