# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1223989931 25200
# Node ID 7b11fbb20dbfa346f4aa4d2a8fd1731490cd26da
# Parent 3131e7898af7f8c28d18e9c0d92c4855b08c1052
[TEST] Fixing 05_hs_gi_errs.py tc of HostSystem to work with/without sblim-base-provider.
Tested with Xen, XenFV, KVM with current sources, with/without sblim-base-provider.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 3131e7898af7 -r 7b11fbb20dbf
suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py
--- a/suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py Tue Oct 14 05:39:41 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py Tue Oct 14 06:12:11 2008
-0700
@@ -29,7 +29,7 @@
# Input:
# ------
# wbemcli gi 'http://localhost:5988/root/virt:Xen_HostSystem.\
-# Wrong="Xen_HostSystem",Name="mx3650a.in.ibm.com"' -nl
+# Wrong="Xen_HostSystem",Name="x3650"' -nl
#
# Output:
# -------
@@ -40,7 +40,7 @@
# Input:
# ------
# wbemcli gi 'http://localhost:5988/root/virt:Xen_HostSystem.\
-# CreationClassName="Wrong",Name="mx3650a.in.ibm.com"' -nl
+# CreationClassName="Wrong",Name="x3650"' -nl
#
# Output:
# -------
@@ -51,7 +51,7 @@
# Input:
# ------
# wbemcli gi 'http://localhost:5988/root/virt:Xen_HostSystem.\
-# CreationClassName="Xen_HostSystem",Wrong="mx3650a.in.ibm.com"'
-nl
+# CreationClassName="Xen_HostSystem",Wrong="x3650"' -nl
#
# Output:
# -------
@@ -78,19 +78,21 @@
from XenKvmLib.common_util import get_host_info, try_getinstance
from XenKvmLib.classes import get_typed_class
from optparse import OptionParser
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
from XenKvmLib.const import do_main
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
expr_values = {
- "invalid_ccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : "No such instance
(CreationClassName)" }, \
- "invalid_name" : {'rc' : pywbem.CIM_ERR_NOT_FOUND, \
- 'desc' : "No such instance (Name)" }
+ "invalid_ccname" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance "
+ "(CreationClassName)" },
+ "invalid_name" : {'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (Name)"
}
}
+bug_sblim='00007'
@do_main(sup_types)
def main():
@@ -104,45 +106,62 @@
if status != PASS:
return status
- conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS),
CIM_NS)
+ conn = assoc.myWBEMConnection('http://%s' % options.ip,
+ (CIM_USER, CIM_PASS), CIM_NS)
# 1) Test by giving Invalid CCName Key Name
field = 'INVALID_CCName_KeyName'
keys = { field : classname, 'Name' : host_name }
- ret_value = try_getinstance(conn, classname, keys, field_name=field, \
- expr_values=expr_values['invalid_ccname'],
bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field,
+ expr_values=expr_values['invalid_ccname'],
+ bug_no="")
if ret_value != PASS:
- logger.error("------ FAILED: Invalid CCName Key Name.------")
- status = ret_value
+ if classname == 'Linux_ComputerSystem':
+ return XFAIL_RC(bug_sblim)
+ else:
+ logger.error("------ FAILED: Invalid CCName Key Name.------")
+ return ret_value
# 2) Test by passing Invalid CCName Key Value
field = 'INVALID_CCName_KeyValue'
keys = { 'CreationClassName' : field, 'Name' : host_name }
- ret_value = try_getinstance(conn, classname, keys, field_name=field, \
- expr_values=expr_values['invalid_ccname'],
bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field,
+ expr_values=expr_values['invalid_ccname'],
+ bug_no="")
if ret_value != PASS:
- logger.error("------ FAILED: Invalid CCName Key Value.------")
- status = ret_value
+ if classname == 'Linux_ComputerSystem':
+ return XFAIL_RC(bug_sblim)
+ else:
+ logger.error("------ FAILED: Invalid CCName Key Value.------")
+ return ret_value
# 3) Test by giving Invalid Name Key Name
field = 'INVALID_Name_KeyName'
keys = { 'CreationClassName' : classname, field : host_name}
- ret_value = try_getinstance(conn, classname, keys, field_name=field, \
- expr_values=expr_values['invalid_name'],
bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field,
+ expr_values=expr_values['invalid_name'],
+ bug_no="")
if ret_value != PASS:
- logger.error("------ FAILED: Invalid Name Key Name.------")
- status = ret_value
+ if classname == 'Linux_ComputerSystem':
+ return XFAIL_RC(bug_sblim)
+ else:
+ logger.error("------ FAILED: Invalid Name Key Name.------")
+ return ret_value
# 4) Test by passing Invalid Name Key Value
field = 'INVALID_Name_KeyValue'
keys = { 'CreationClassName' : classname, 'Name' : field }
- ret_value = try_getinstance(conn, classname, keys, field_name=field, \
- expr_values=expr_values['invalid_name'],
bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field,
+ expr_values=expr_values['invalid_name'],
+ bug_no="")
if ret_value != PASS:
- logger.error("------ FAILED: Invalid Name Key Value.------")
- status = ret_value
+ if classname == 'Linux_ComputerSystem':
+ return XFAIL_RC(bug_sblim)
+ else:
+ logger.error("------ FAILED: Invalid Name Key Value.------")
+ return ret_value
- return status
+ return PASS
if __name__ == "__main__":
sys.exit(main())