# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1226641347 28800
# Node ID feb7ac23474781048f7065da317087b7064d21f7
# Parent 8d6f2db22eda9bda08ff26caa8982f137a3d4486
[TEST] Add branch to SettingsDefineCapabilities/03_forward_errs.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 8d6f2db22eda -r feb7ac234747
suites/libvirt-cim/cimtest/SettingsDefineCapabilities/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/03_forward_errs.py Tue Nov 11
00:19:20 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/03_forward_errs.py Thu Nov 13
21:42:27 2008 -0800
@@ -32,11 +32,11 @@
from XenKvmLib.common_util import try_assoc
from XenKvmLib import assoc
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from XenKvmLib.classes import get_typed_class
platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
-
+libvirt_modify_setting_changes = 721
expr_values = {
"invalid_instid_keyname" : { 'rc' : pywbem.CIM_ERR_FAILED,
'desc' : 'Missing InstanceID'},
@@ -64,7 +64,7 @@
expr_values=expr_values['invalid_instid_keyname'],
bug_no="")
-def err_invalid_instid_keyvalue(virt, conn, field):
+def err_invalid_instid_keyvalue(server, virt, conn, field):
# Input:
# ------
# wbemcli ai -ac Xen_SettingsDefineCapabilities \
@@ -79,6 +79,12 @@
assoc_classname = get_typed_class(virt, "SettingsDefineCapabilities")
classname = get_typed_class(virt, "AllocationCapabilities")
keys = { 'InstanceID' : field }
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if curr_cim_rev >= libvirt_modify_setting_changes:
+ expr_values['invalid_instid_keyvalue'] = {
+ 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : 'No such instance'
+ }
return try_assoc(conn, classname, assoc_classname, keys, field_name=field, \
expr_values=expr_values['invalid_instid_keyvalue'],
bug_no="")
@@ -95,7 +101,7 @@
if ret_value != PASS:
logger.error("------ FAILED: Invalid InstanceID Key Name.------")
return ret_value
- ret_value = err_invalid_instid_keyvalue(virt, conn,
+ ret_value = err_invalid_instid_keyvalue(options.ip, virt, conn,
field='INVALID_InstID_KeyValue')
if ret_value != PASS:
logger.error("------ FAILED: Invalid InstanceID Key Value.------")