[PATCH 0 of 9] Remove XFAILs from tc; providers support SBLIM refs

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705448 28800 # Node ID 87ae0e86a0e1e3eecf218f11ec079958449a95fc # Parent ac693577d27b1b5f24fdc6c50272b11d02c91c7f [TEST] Have get_host_info() return the host instance. Have check_sblim() store the original namespace (since the test might be using root/virt or root/interop). Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r ac693577d27b -r 87ae0e86a0e1 suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Nov 14 12:48:36 2008 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Nov 14 15:30:48 2008 -0800 @@ -205,41 +205,24 @@ return PASS, dom_cs -def get_host_info(server, virt="Xen"): - status = PASS - host_name = '' - host_ccn = '' - keys = ['Name', 'CreationClassName'] +def get_host_info(server, virt): + try: + status, linux_cs = check_sblim(server) + if status == PASS: + return status, linux_cs - try: - - # This following modification is req to accomadate the - # sblim-base-provider provider related changes - - ret, linux_cs = check_sblim(server) hs_class = get_typed_class(virt, 'HostSystem') host_info = enumclass.EnumInstances(server, hs_class) - if ret == PASS: - host_sys = linux_cs - elif len(host_info) == 1: - host_sys = host_info[0] + if len(host_info) == 1: + return PASS, host_info[0] else: - logger.error("Error in getting HostSystem information, Exiting...") - return FAIL, host_name, host_ccn - - if host_sys.Name == "": - logger.error("HostName seems to be empty") - status = FAIL - else: - # Instance of the HostSystem - host_ccn = host_sys.CreationClassName - host_name = host_sys.Name + logger.error("Error in getting HostSystem instance") + return FAIL, None except Exception,detail: - logger.error(CIM_ERROR_ENUMERATE, 'Hostsystem') logger.error("Exception: %s", detail) - status = FAIL - return status, host_name, host_ccn + + return FAIL, None def try_assoc(conn, classname, assoc_classname, keys, field_name, \ expr_values, bug_no): @@ -497,6 +480,7 @@ def check_sblim(server, virt='Xen'): status = FAIL + prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/cimv2' keys = ['Name', 'CreationClassName'] linux_cs = None @@ -512,5 +496,5 @@ logger.error(CIM_ERROR_ENUMERATE, 'Linux_ComputerSystem') logger.error("Exception: %s", detail) - Globals.CIM_NS = 'root/virt' + Globals.CIM_NS = prev_namespace return status, linux_cs

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705449 28800 # Node ID 0967f6e02888cb791e5a69404bae89dffc332d5c # Parent 87ae0e86a0e1e3eecf218f11ec079958449a95fc [TEST] Have Assocatiors() / AssciatorNames() set proper namespace If the prefix of the class is Linux_, use root/cimv2 as the namespace. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 87ae0e86a0e1 -r 0967f6e02888 suites/libvirt-cim/lib/XenKvmLib/assoc.py --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Nov 14 15:30:48 2008 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Nov 14 15:30:49 2008 -0800 @@ -26,7 +26,7 @@ from VirtLib import utils import pywbem from pywbem.cim_obj import CIMInstanceName -from XenKvmLib.classes import get_typed_class +from XenKvmLib.classes import get_typed_class, get_class_type from CimTest.ReturnCodes import PASS, FAIL from CimTest.Globals import logger @@ -36,6 +36,10 @@ Return a list of CIMInstanceName objects, if an valid @keys is provided, or CIMClassName objects, if no @keys is provided, or None on failure''' + + if (get_class_type(classname) == "Linux"): + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/cimv2' conn = myWBEMConnection('http://%s' % host, (Globals.CIM_USER, Globals.CIM_PASS), @@ -51,6 +55,9 @@ print arg[1] return names + if (get_class_type(classname) == "Linux"): + Globals.CIM_NS = prev_namespace + return names def Associators(host, assoc_cn, classname, **keys): @@ -59,6 +66,10 @@ Return a list of CIMInstanceName objects, if an valid @keys is provided, or CIMClassName objects, if no @keys is provided, or None on failure''' + + if (get_class_type(classname) == "Linux"): + prev_namespace = Globals.CIM_NS + Globals.CIM_NS = 'root/cimv2' conn = myWBEMConnection('http://%s' % host, (Globals.CIM_USER, Globals.CIM_PASS), @@ -72,6 +83,9 @@ names = conn.Associators(instanceref, AssocClass=assoc_cn) except pywbem.CIMError, arg: print arg[1] + + if (get_class_type(classname) == "Linux"): + Globals.CIM_NS = prev_namespace return names

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705449 28800 # Node ID aca519aaabf055d41e3b721bd5917d0086efccd5 # Parent 0967f6e02888cb791e5a69404bae89dffc332d5c [TEST] Update HostedService tests to expect an instance from get_host_info(). Also remove XFAILs as these tests should pass now. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedService/01_forward.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/01_forward.py Fri Nov 14 15:30:49 2008 -0800 @@ -30,12 +30,11 @@ from CimTest import Globals from XenKvmLib.const import do_main from CimTest.Globals import logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.common_util import get_host_info from XenKvmLib.const import get_provider_version sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] -bug_sblim = '00007' libvirtcim_hr_crs_changes = 695 @do_main(sup_types) @@ -44,16 +43,20 @@ virt = options.virt server = options.ip try: - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Failed to get host info.") return status + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name an = get_typed_class(virt, "HostedService") service = assoc.AssociatorNames(server, an, host_ccn, CreationClassName = host_ccn, Name = host_name) + except Exception, deatils: logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % host_name) logger.error("Exception: details %s", details) @@ -82,13 +85,9 @@ ccn_list = Set(ccn_list) if len((val_serv) - (ccn_list)) != 0: - if host_ccn == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - - logger.error("Mismatching services values") - logger.error("'%s' returned %d, expected %d", - an, len(ccn_list), len(val_serv)) + logger.error("Mismatching services values") + logger.error("'%s' returned %d, expected %d", + an, len(ccn_list), len(val_serv)) return FAIL return PASS diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Nov 14 15:30:49 2008 -0800 @@ -52,11 +52,14 @@ if cim_rev >= libvirtcim_hr_crs_changes: servicelist['ConsoleRedirectionService'] = "ConsoleRedirectionService" - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Failed to get host info.") return status + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name + an = get_typed_class(virt, "HostedService") for k, v in servicelist.iteritems(): cn = get_typed_class(virt, k) diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Nov 14 15:30:49 2008 -0800 @@ -30,9 +30,8 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \ CIM_PASS, CIM_NS from XenKvmLib.const import do_main -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL -bug = '00007' sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] exp_values = { "invalid_ccname" : {"rc" : pywbem.CIM_ERR_NOT_FOUND, \ @@ -47,12 +46,23 @@ rc = -1 status = FAIL keys = ['Name', 'CreationClassName'] - status, host_name, host_ccn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name + + if (host_ccn == "Linux_ComputerSystem"): + exp_values['invalid_ccname'] = {"rc" : pywbem.CIM_ERR_INVALID_PARAMETER, + "desc" : "Linux_ComputerSystem" + } + exp_values['invalid_name'] = {"rc" : pywbem.CIM_ERR_INVALID_PARAMETER, + "desc" : "Linux_ComputerSystem" + } + conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) @@ -62,21 +72,15 @@ ret = try_assoc(conn, host_ccn, assoc_classname, keys, "Name", \ exp_values['invalid_name'], bug_no="") if ret != PASS: - if host_ccn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid Name Key Name.------") - return FAIL + logger.error("------ FAILED: Invalid Name Key Name.------") + return FAIL keys = {"Name" : host_name, "Wrong" : host_ccn} ret = try_assoc(conn, host_ccn, assoc_classname, keys, "CreationClassName", \ exp_values['invalid_ccname'], bug_no="") if ret != PASS: - if host_ccn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid CreationClassName Key Name.------") - return FAIL + logger.error("------ FAILED: Invalid CreationClassName Key Name.------") + return FAIL return status diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Nov 14 15:30:49 2008 -0800 @@ -45,10 +45,13 @@ options = main.options status = FAIL keys = ['Name', 'CreationClassName'] - status, host_name, host_ccn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name rpcs = get_typed_class(options.virt, "ResourcePoolConfigurationService") vsms = get_typed_class(options.virt, "VirtualSystemManagementService")

can you remove the XFAIL as well from the import statement: from CimTest.ReturnCodes import PASS, FAIL, XFAIL in the test case 02_reverse.py 04_reverse_errs.py The XFAIL import have been lying there for sometime. The tc can be applied for now. You can send an updated patch. Thanks and Regards, Deepti. Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705449 28800 # Node ID aca519aaabf055d41e3b721bd5917d0086efccd5 # Parent 0967f6e02888cb791e5a69404bae89dffc332d5c [TEST] Update HostedService tests to expect an instance from get_host_info().
Also remove XFAILs as these tests should pass now.
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedService/01_forward.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/01_forward.py Fri Nov 14 15:30:49 2008 -0800 @@ -30,12 +30,11 @@ from CimTest import Globals from XenKvmLib.const import do_main from CimTest.Globals import logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.common_util import get_host_info from XenKvmLib.const import get_provider_version
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] -bug_sblim = '00007' libvirtcim_hr_crs_changes = 695
@do_main(sup_types) @@ -44,16 +43,20 @@ virt = options.virt server = options.ip try: - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Failed to get host info.") return status + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name
an = get_typed_class(virt, "HostedService") service = assoc.AssociatorNames(server, an, host_ccn, CreationClassName = host_ccn, Name = host_name) + except Exception, deatils: logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % host_name) logger.error("Exception: details %s", details) @@ -82,13 +85,9 @@ ccn_list = Set(ccn_list)
if len((val_serv) - (ccn_list)) != 0: - if host_ccn == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - - logger.error("Mismatching services values") - logger.error("'%s' returned %d, expected %d", - an, len(ccn_list), len(val_serv)) + logger.error("Mismatching services values") + logger.error("'%s' returned %d, expected %d", + an, len(ccn_list), len(val_serv)) return FAIL
return PASS diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Nov 14 15:30:49 2008 -0800 @@ -52,11 +52,14 @@ if cim_rev >= libvirtcim_hr_crs_changes: servicelist['ConsoleRedirectionService'] = "ConsoleRedirectionService"
- status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Failed to get host info.") return status
+ host_ccn = host_inst.CreationClassName + host_name = host_inst.Name + an = get_typed_class(virt, "HostedService") for k, v in servicelist.iteritems(): cn = get_typed_class(virt, k) diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Nov 14 15:30:49 2008 -0800 @@ -30,9 +30,8 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \ CIM_PASS, CIM_NS from XenKvmLib.const import do_main -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL
-bug = '00007' sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] exp_values = { "invalid_ccname" : {"rc" : pywbem.CIM_ERR_NOT_FOUND, \ @@ -47,12 +46,23 @@ rc = -1 status = FAIL keys = ['Name', 'CreationClassName'] - status, host_name, host_ccn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL
+ host_ccn = host_inst.CreationClassName + host_name = host_inst.Name + + if (host_ccn == "Linux_ComputerSystem"): + exp_values['invalid_ccname'] = {"rc" : pywbem.CIM_ERR_INVALID_PARAMETER, + "desc" : "Linux_ComputerSystem" + } + exp_values['invalid_name'] = {"rc" : pywbem.CIM_ERR_INVALID_PARAMETER, + "desc" : "Linux_ComputerSystem" + } + conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) @@ -62,21 +72,15 @@ ret = try_assoc(conn, host_ccn, assoc_classname, keys, "Name", \ exp_values['invalid_name'], bug_no="") if ret != PASS: - if host_ccn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid Name Key Name.------") - return FAIL + logger.error("------ FAILED: Invalid Name Key Name.------") + return FAIL
keys = {"Name" : host_name, "Wrong" : host_ccn} ret = try_assoc(conn, host_ccn, assoc_classname, keys, "CreationClassName", \ exp_values['invalid_ccname'], bug_no="") if ret != PASS: - if host_ccn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid CreationClassName Key Name.------") - return FAIL + logger.error("------ FAILED: Invalid CreationClassName Key Name.------") + return FAIL
return status diff -r 0967f6e02888 -r aca519aaabf0 suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Nov 14 15:30:49 2008 -0800 @@ -45,10 +45,13 @@ options = main.options status = FAIL keys = ['Name', 'CreationClassName'] - status, host_name, host_ccn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name
rpcs = get_typed_class(options.virt, "ResourcePoolConfigurationService") vsms = get_typed_class(options.virt, "VirtualSystemManagementService")
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

Deepti B Kalakeri wrote:
can you remove the XFAIL as well from the import statement:
from CimTest.ReturnCodes import PASS, FAIL, XFAIL
in the test case 02_reverse.py 04_reverse_errs.py
The XFAIL import have been lying there for sometime. The tc can be applied for now. You can send an updated patch.
Deepti, I'll send an updated set. I'll go ahead and apply this now. =) Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705450 28800 # Node ID 59a6bdb3083be965c9959447b117efd57bd29e9d # Parent aca519aaabf055d41e3b721bd5917d0086efccd5 [TEST] Update HostedDependency tests to expect an instance from get_host_info(). Also remove XFAILs as these tests should pass now. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r aca519aaabf0 -r 59a6bdb3083b suites/libvirt-cim/cimtest/HostedDependency/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Fri Nov 14 15:30:50 2008 -0800 @@ -78,11 +78,13 @@ status = FAIL return status - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: cxml.undefine(server) return status + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name cs_class = get_typed_class(options.virt, 'ComputerSystem') try: cs = enumclass.EnumInstances(server, cs_class) diff -r aca519aaabf0 -r 59a6bdb3083b suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Fri Nov 14 15:30:50 2008 -0800 @@ -48,7 +48,7 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger from XenKvmLib.const import do_main -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.common_util import get_host_info, call_request_state_change sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -56,7 +56,6 @@ test_dom = "hd_domain" test_mac = "00:11:22:33:44:55" TIME = "00000000000000.000000:000" -bug_sblim = "00007" @do_main(sup_types) def main(): @@ -83,11 +82,14 @@ return FAIL try: - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: cxml.destroy(server) cxml.undefine(server) return status + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name cs_class = get_typed_class(options.virt, 'ComputerSystem') cs = enumclass.EnumInstances(server, cs_class) @@ -118,8 +120,6 @@ len(systems)) cxml.destroy(server) cxml.undefine(server) - return XFAIL_RC(bug_sblim) - ccn = cs[0].CreationClassName for guest in systems: diff -r aca519aaabf0 -r 59a6bdb3083b suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py --- a/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Fri Nov 14 15:30:50 2008 -0800 @@ -44,14 +44,13 @@ CIM_ERROR_GETINSTANCE from XenKvmLib.const import do_main from XenKvmLib.devices import CIM_Instance -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'KVM', 'XenFV'] TIME = "00000000000000.000000:000" test_dom = "hd_domain1" test_mac = "00:11:22:33:44:55" -bug_sblim = "00007" def create_list(instance): new_list = { @@ -128,12 +127,15 @@ cxml.undefine(server) return FAIL - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Failed to get host info") cxml.destroy(server) cxml.undefine(server) return status + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name try: @@ -157,7 +159,6 @@ logger.error("HostedDependency didn't return any instances.") cxml.destroy(server) cxml.undefine(server) - return XFAIL_RC(bug_sblim) hs_field_list = [] for hsi in hs: diff -r aca519aaabf0 -r 59a6bdb3083b suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Fri Nov 14 15:30:49 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Fri Nov 14 15:30:50 2008 -0800 @@ -29,6 +29,7 @@ # Date : 17-01-2008 import sys +import pywbem from VirtLib import utils from XenKvmLib import assoc from XenKvmLib import vxml @@ -36,36 +37,40 @@ from XenKvmLib.const import do_main from XenKvmLib.classes import get_typed_class from XenKvmLib.common_util import get_host_info, try_assoc -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "hd_domain1" test_mac = "00:11:22:33:44:55" -bug_sblim='00007' -exp_rc = 6 #CIM_ERR_NOT_FOUND -exp_d1 = "No such instance (Name)" -exp_d2 = "No such instance (CreationClassName)" +def set_expr_values(host_ccn): + if (host_ccn == "Linux_ComputerSystem"): + exp_rc = pywbem.CIM_ERR_INVALID_PARAMETER + exp_d1 = "INVALID" + exp_d2 = "INVALID" + else: + exp_rc = pywbem.CIM_ERR_NOT_FOUND + exp_d1 = "No such instance (Name)" + exp_d2 = "No such instance (CreationClassName)" -expr_values = { - "INVALID_KeyName" : { 'rc' : exp_rc, 'desc' : exp_d1 }, - "INVALID_NameValue" : { 'rc' : exp_rc, 'desc' : exp_d1 }, - "INVALID_CCNKeyName" : { 'rc' : exp_rc, 'desc' : exp_d2 }, - "INVALID_CCNameValue" : { 'rc' : exp_rc, 'desc' : exp_d2 } - } + expr_values = { + "INVALID_KeyName" : { 'rc' : exp_rc, 'desc' : exp_d1 }, + "INVALID_NameValue" : { 'rc' : exp_rc, 'desc' : exp_d1 }, + "INVALID_CCNKeyName" : { 'rc' : exp_rc, 'desc' : exp_d2 }, + "INVALID_CCNameValue" : { 'rc' : exp_rc, 'desc' : exp_d2 } + } + + return expr_values def verify_err_fields(cxml, server, conn, keys, classname, - assoc_classname, msg, field): + assoc_classname, msg, field, expr_values): try: ret = try_assoc(conn, classname, assoc_classname, keys, field_name=field, expr_values=expr_values[field], bug_no="") if ret != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("--- FAILED: %s---", msg) + logger.error("--- FAILED: %s---", msg) cxml.destroy(server) except Exception, details: logger.error("Exception: %s", details) @@ -93,17 +98,22 @@ (CIM_USER, CIM_PASS), CIM_NS) acn = get_typed_class(virt, 'HostedDependency') - status, host_name, classname = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status: logger.error("Unable to get host info") cxml.destroy(server) return status + classname = host_inst.CreationClassName + host_name = host_inst.Name + + expr_values = set_expr_values(classname) + msg = 'Invalid Name Key Name' field = 'INVALID_KeyName' keys = { 'CreationClassName' : classname, field : host_name } ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field) + acn, msg, field, expr_values) if ret_value != PASS: return ret_value @@ -111,7 +121,7 @@ field='INVALID_NameValue' keys = { 'CreationClassName' : classname, 'Name' : field } ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field) + acn, msg, field, expr_values) if ret_value != PASS: return ret_value @@ -119,7 +129,7 @@ field='INVALID_CCNKeyName' keys = { field : classname, 'Name' : host_name } ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field) + acn, msg, field, expr_values) if ret_value != PASS: return ret_value @@ -127,7 +137,7 @@ field='INVALID_CCNameValue' keys = { 'CreationClassName' : field, 'Name' : host_name } ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field) + acn, msg, field, expr_values) cxml.destroy(server) return ret_value if __name__ == "__main__":

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705450 28800 # Node ID 5466028a80608d44d61b06c3e38d5ef395cad169 # Parent 59a6bdb3083be965c9959447b117efd57bd29e9d [TEST] Update HostSystem tests to expect an instance from get_host_info(). Also remove XFAILs as these tests should pass now. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Fri Nov 14 15:30:50 2008 -0800 @@ -55,13 +55,12 @@ from XenKvmLib.common_util import get_host_info from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \ CIM_ERROR_ASSOCIATORS -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ verify_diskrasd_values, verify_memrasd_values, verify_displayrasd_values, \ rasd_init_list sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] -bug_sblim = '00007' test_dom = "CrossClass_GuestDom" test_vcpus = 1 @@ -125,11 +124,8 @@ CreationClassName = cn, Name = name) if len(assoc_info) < 1: - if cn == 'Linux_ComputerSystem': - status = XFAIL_RC(bug_sblim) - else: - logger.error("%s returned %i %s objects", an, len(assoc_info), qcn) - status = FAIL + logger.error("%s returned %i %s objects", an, len(assoc_info), qcn) + status = FAIL except Exception, detail: print_err(CIM_ERROR_ASSOCIATORNAMES, detail, cn) @@ -199,16 +195,17 @@ options = main.options server = options.ip status = PASS - status, host_name, classname = get_host_info(server, options.virt) + status, host_inst = get_host_info(server, options.virt) if status != PASS: return status + status, vsxml = setup_env(server, options.virt) if status != PASS or vsxml == None: return status - cn = classname + cn = host_inst.CreationClassName an = get_typed_class(options.virt, 'HostedDependency') qcn = get_typed_class(options.virt, 'ComputerSystem') - name = host_name + name = host_inst.Name status, cs_assoc_info = get_assoc_info(server, cn, an, qcn, name, vsxml) if status != PASS or len(cs_assoc_info) == 0: return status diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py --- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri Nov 14 15:30:50 2008 -0800 @@ -47,7 +47,7 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES from XenKvmLib.const import do_main -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.test_xml import testxml from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.const import get_provider_version @@ -55,7 +55,6 @@ sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst_test" test_vcpus = 1 -bug_sblim='00007' libvirt_rasd_template_changes = 707 def setup_env(server, virt="Xen"): @@ -102,8 +101,8 @@ host = live.hostname(server) try: - status, hostname, clsname = get_host_info(server, virt) - if hostname != host: + status, host_inst = get_host_info(server, virt) + if host_inst.Name != host: status = FAIL logger.error("Hostname mismatch") @@ -111,7 +110,7 @@ logger.error("Exception in %s : %s" % (cn, detail)) status = FAIL - return status, hostname, clsname + return status, host_inst.Name, host_inst.CreationClassName def get_hostrespool(server, hostsys, clsname, virt="Xen"): an1 = get_typed_class(virt, "HostedResourcePool") @@ -132,12 +131,9 @@ CreationClassName = clsname, Name = hostsys) if len(assoc_info) < 4: - if clsname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim), devpool - else: - logger.error("'%s' has returned %i instances, expected 4" - " instances", an1, len(assoc_info)) - return FAIL, devpool + logger.error("'%s' has returned %i instances, expected 4" + " instances", an1, len(assoc_info)) + return FAIL, devpool for inst in assoc_info: for a, val in ccnlist.items(): diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800 @@ -56,7 +56,7 @@ from XenKvmLib.assoc import AssociatorNames, Associators from XenKvmLib.common_util import get_host_info from XenKvmLib.classes import get_typed_class -from CimTest.ReturnCodes import PASS, FAIL, SKIP, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.logicaldevices import verify_device_values @@ -66,7 +66,6 @@ test_mac = "00:11:22:33:44:aa" test_mem = 128 test_vcpus = 1 -bug_sblim='00007' def print_err(err, detail, cn): logger.error(err % cn) @@ -161,12 +160,9 @@ CreationClassName=host_cn, Name = hostname) if len(assoc_info) < 1: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim), assoc_info - else: - logger.error("%s returned %i %s objects", - an, len(assoc_info), qcn) - return FAIL, assoc_info + logger.error("%s returned %i %s objects", + an, len(assoc_info), qcn) + return FAIL, assoc_info except Exception, detail: print_err(CIM_ERROR_ASSOCIATORNAMES, detail, host_cn) @@ -213,7 +209,7 @@ server = options.ip virt=options.virt # Get the host info - status, host_name, classname = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: return status @@ -239,7 +235,8 @@ net_name = vsxml.xml_get_net_network() # Get the hostedResourcePool info first - host_cn = classname + host_name = host_inst.Name + host_cn = host_inst.CreationClassName an = get_typed_class(virt, "HostedResourcePool") qcn = "Device Pool" logger.error("DEBUG host_name is %s", host_name) diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py --- a/suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py Fri Nov 14 15:30:50 2008 -0800 @@ -78,7 +78,7 @@ 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, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL, SKIP from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS from XenKvmLib.const import do_main @@ -92,7 +92,6 @@ 'desc' : "No such instance (Name)" } } -bug_sblim='00007' @do_main(sup_types) def main(): @@ -102,9 +101,16 @@ if options.virt == "XenFV": options.virt = 'Xen' - status, host_name, classname = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: return status + + classname = host_inst.CreationClassName + host_name = host_inst.CreationClassName + + #Test calls GetInstance() - no need to test GetInstance() of SBLIM providers + if (classname == "Linux_ComputerSystem"): + return SKIP conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) @@ -116,11 +122,8 @@ expr_values=expr_values['invalid_ccname'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid CCName Key Name.------") - return ret_value + logger.error("------ FAILED: Invalid CCName Key Name.------") + return ret_value # 2) Test by passing Invalid CCName Key Value field = 'INVALID_CCName_KeyValue' @@ -129,11 +132,8 @@ expr_values=expr_values['invalid_ccname'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid CCName Key Value.------") - return ret_value + logger.error("------ FAILED: Invalid CCName Key Value.------") + return ret_value # 3) Test by giving Invalid Name Key Name field = 'INVALID_Name_KeyName' @@ -142,11 +142,8 @@ expr_values=expr_values['invalid_name'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid Name Key Name.------") - return ret_value + logger.error("------ FAILED: Invalid Name Key Name.------") + return ret_value # 4) Test by passing Invalid Name Key Value field = 'INVALID_Name_KeyValue' @@ -155,11 +152,8 @@ expr_values=expr_values['invalid_name'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid Name Key Value.------") - return ret_value + logger.error("------ FAILED: Invalid Name Key Value.------") + return ret_value return PASS diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py --- a/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Fri Nov 14 15:30:50 2008 -0800 @@ -99,9 +99,12 @@ def get_vsms_info(): - status, host_name, classname = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: return status, [] + + classname = host_inst.CreationClassName + host_name = host_inst.Name status, service_assoc_info = get_assocnames_info(server, classname, assoc_name, req_cn, host_name) if status != PASS or len(service_assoc_info) == 0:

Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705450 28800 # Node ID 5466028a80608d44d61b06c3e38d5ef395cad169 # Parent 59a6bdb3083be965c9959447b117efd57bd29e9d [TEST] Update HostSystem tests to expect an instance from get_host_info().
Also remove XFAILs as these tests should pass now.
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Fri Nov 14 15:30:50 2008 -0800 @@ -55,13 +55,12 @@ from XenKvmLib.common_util import get_host_info from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \ CIM_ERROR_ASSOCIATORS -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ verify_diskrasd_values, verify_memrasd_values, verify_displayrasd_values, \ rasd_init_list
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] -bug_sblim = '00007'
test_dom = "CrossClass_GuestDom" test_vcpus = 1 @@ -125,11 +124,8 @@ CreationClassName = cn, Name = name) if len(assoc_info) < 1: - if cn == 'Linux_ComputerSystem': - status = XFAIL_RC(bug_sblim) - else: - logger.error("%s returned %i %s objects", an, len(assoc_info), qcn) - status = FAIL + logger.error("%s returned %i %s objects", an, len(assoc_info), qcn) + status = FAIL
except Exception, detail: print_err(CIM_ERROR_ASSOCIATORNAMES, detail, cn) @@ -199,16 +195,17 @@ options = main.options server = options.ip status = PASS - status, host_name, classname = get_host_info(server, options.virt) + status, host_inst = get_host_info(server, options.virt) if status != PASS: return status + status, vsxml = setup_env(server, options.virt) if status != PASS or vsxml == None: return status - cn = classname + cn = host_inst.CreationClassName an = get_typed_class(options.virt, 'HostedDependency') qcn = get_typed_class(options.virt, 'ComputerSystem') - name = host_name + name = host_inst.Name status, cs_assoc_info = get_assoc_info(server, cn, an, qcn, name, vsxml) if status != PASS or len(cs_assoc_info) == 0: return status diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
This tc fails with the sblim-base-provider installed: -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - 'Xen_HostedResourcePool' has returned 0 instances, expected 4 instances CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri Nov 14 15:30:50 2008 -0800 @@ -47,7 +47,7 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES from XenKvmLib.const import do_main -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.test_xml import testxml from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.const import get_provider_version @@ -55,7 +55,6 @@ sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst_test" test_vcpus = 1 -bug_sblim='00007' libvirt_rasd_template_changes = 707
def setup_env(server, virt="Xen"): @@ -102,8 +101,8 @@ host = live.hostname(server)
try: - status, hostname, clsname = get_host_info(server, virt) - if hostname != host: + status, host_inst = get_host_info(server, virt) + if host_inst.Name != host: status = FAIL logger.error("Hostname mismatch")
@@ -111,7 +110,7 @@ logger.error("Exception in %s : %s" % (cn, detail)) status = FAIL
- return status, hostname, clsname + return status, host_inst.Name, host_inst.CreationClassName
def get_hostrespool(server, hostsys, clsname, virt="Xen"): an1 = get_typed_class(virt, "HostedResourcePool") @@ -132,12 +131,9 @@ CreationClassName = clsname, Name = hostsys) if len(assoc_info) < 4: - if clsname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim), devpool - else: - logger.error("'%s' has returned %i instances, expected 4" - " instances", an1, len(assoc_info)) - return FAIL, devpool + logger.error("'%s' has returned %i instances, expected 4" + " instances", an1, len(assoc_info)) + return FAIL, devpool
for inst in assoc_info: for a, val in ccnlist.items(): diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800
This tc fails with the sblim-base-provider installed: -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: FAIL ERROR - DEBUG host_name is elm3b43.beaverton.ibm.com ERROR - Xen_HostedResourcePool returned 0 Device Pool objects CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
@@ -56,7 +56,7 @@ from XenKvmLib.assoc import AssociatorNames, Associators from XenKvmLib.common_util import get_host_info from XenKvmLib.classes import get_typed_class -from CimTest.ReturnCodes import PASS, FAIL, SKIP, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.logicaldevices import verify_device_values
@@ -66,7 +66,6 @@ test_mac = "00:11:22:33:44:aa" test_mem = 128 test_vcpus = 1 -bug_sblim='00007'
def print_err(err, detail, cn): logger.error(err % cn) @@ -161,12 +160,9 @@ CreationClassName=host_cn, Name = hostname) if len(assoc_info) < 1: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim), assoc_info - else: - logger.error("%s returned %i %s objects", - an, len(assoc_info), qcn) - return FAIL, assoc_info + logger.error("%s returned %i %s objects", + an, len(assoc_info), qcn) + return FAIL, assoc_info
except Exception, detail: print_err(CIM_ERROR_ASSOCIATORNAMES, detail, host_cn) @@ -213,7 +209,7 @@ server = options.ip virt=options.virt # Get the host info - status, host_name, classname = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: return status
@@ -239,7 +235,8 @@ net_name = vsxml.xml_get_net_network()
# Get the hostedResourcePool info first - host_cn = classname + host_name = host_inst.Name + host_cn = host_inst.CreationClassName an = get_typed_class(virt, "HostedResourcePool") qcn = "Device Pool" logger.error("DEBUG host_name is %s", host_name) diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py --- a/suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/05_hs_gi_errs.py Fri Nov 14 15:30:50 2008 -0800 @@ -78,7 +78,7 @@ 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, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL, SKIP from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS from XenKvmLib.const import do_main
@@ -92,7 +92,6 @@ 'desc' : "No such instance (Name)" } }
-bug_sblim='00007'
@do_main(sup_types) def main(): @@ -102,9 +101,16 @@ if options.virt == "XenFV": options.virt = 'Xen'
- status, host_name, classname = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: return status + + classname = host_inst.CreationClassName + host_name = host_inst.CreationClassName + + #Test calls GetInstance() - no need to test GetInstance() of SBLIM providers + if (classname == "Linux_ComputerSystem"): + return SKIP
conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) @@ -116,11 +122,8 @@ expr_values=expr_values['invalid_ccname'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid CCName Key Name.------") - return ret_value + logger.error("------ FAILED: Invalid CCName Key Name.------") + return ret_value
# 2) Test by passing Invalid CCName Key Value field = 'INVALID_CCName_KeyValue' @@ -129,11 +132,8 @@ expr_values=expr_values['invalid_ccname'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid CCName Key Value.------") - return ret_value + logger.error("------ FAILED: Invalid CCName Key Value.------") + return ret_value
# 3) Test by giving Invalid Name Key Name field = 'INVALID_Name_KeyName' @@ -142,11 +142,8 @@ expr_values=expr_values['invalid_name'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid Name Key Name.------") - return ret_value + logger.error("------ FAILED: Invalid Name Key Name.------") + return ret_value
# 4) Test by passing Invalid Name Key Value field = 'INVALID_Name_KeyValue' @@ -155,11 +152,8 @@ expr_values=expr_values['invalid_name'], bug_no="") if ret_value != PASS: - if classname == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - logger.error("------ FAILED: Invalid Name Key Value.------") - return ret_value + logger.error("------ FAILED: Invalid Name Key Value.------") + return ret_value
return PASS
diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py --- a/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Fri Nov 14 15:30:50 2008 -0800 @@ -99,9 +99,12 @@
def get_vsms_info(): - status, host_name, classname = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: return status, [] + + classname = host_inst.CreationClassName + host_name = host_inst.Name status, service_assoc_info = get_assocnames_info(server, classname, assoc_name, req_cn, host_name) if status != PASS or len(service_assoc_info) == 0:
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
This tc fails with the sblim-base-provider installed: -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - 'Xen_HostedResourcePool' has returned 0 instances, expected 4 instances CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800
This tc fails with the sblim-base-provider installed: -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: FAIL ERROR - DEBUG host_name is elm3b43.beaverton.ibm.com ERROR - Xen_HostedResourcePool returned 0 Device Pool objects CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
These also are a registration issue. Can you verify your registration and then retest? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

Kaitlin Rupert wrote:
diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py This tc fails with the sblim-base-provider installed:
HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - 'Xen_HostedResourcePool' has returned 0 instances, expected 4 instances CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
diff -r 59a6bdb3083b -r 5466028a8060 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Nov 14 15:30:50 2008 -0800 This tc fails with the sblim-base-provider installed:
HostSystem - 04_hs_to_EAPF.py: FAIL ERROR - DEBUG host_name is elm3b43.beaverton.ibm.com ERROR - Xen_HostedResourcePool returned 0 Device Pool objects CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
These also are a registration issue. Can you verify your registration and then retest? Thanks!
Ya the problem was due to the provider registration. But the tc is now failing bcs of the following error: -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: FAIL ERROR - DEBUG host_name is elm3b41 ERROR - KeyError : u'KVM_GraphicsPool' Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 129, in do_try File "04_hs_to_EAPF.py", line 248, in main in_pllist = pool_init_list(virt, pool, net_name, default_pool_name) File "04_hs_to_EAPF.py", line 102, in pool_init_list if exp_pllist[CName] == InstID: KeyError: u'KVM_GraphicsPool' ERROR - None -------------------------------------------------------------------- This error is listed in the wiki and needs to be fixed. This error occurs with and without sblim-base-provider. Thanks and Regards, Deepti.

These also are a registration issue. Can you verify your registration and then retest? Thanks!
Ya the problem was due to the provider registration. But the tc is now failing bcs of the following error: -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: FAIL ERROR - DEBUG host_name is elm3b41 ERROR - KeyError : u'KVM_GraphicsPool' Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 129, in do_try File "04_hs_to_EAPF.py", line 248, in main in_pllist = pool_init_list(virt, pool, net_name, default_pool_name) File "04_hs_to_EAPF.py", line 102, in pool_init_list if exp_pllist[CName] == InstID: KeyError: u'KVM_GraphicsPool' ERROR - None --------------------------------------------------------------------
This error is listed in the wiki and needs to be fixed. This error occurs with and without sblim-base-provider.
Thanks for double checking these tests. I can follow up with a patch to fix this issue. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705451 28800 # Node ID 5f39bb761dcb4526e8b43fb6a89a3a7e61589fb1 # Parent 5466028a80608d44d61b06c3e38d5ef395cad169 [TEST] Update HostedResourcePool tests to expect instance from get_host_info(). Also remove XFAILs as these tests should pass now. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:51 2008 -0800 @@ -31,21 +31,24 @@ from XenKvmLib.const import default_network_name from CimTest import Globals from CimTest.Globals import logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.const import do_main, default_pool_name from XenKvmLib.classes import get_typed_class -bug = '00007' sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @do_main(sup_types) def main(): options = main.options virt = options.virt keys = ['Name', 'CreationClassName'] - status, host_sys, host_cn = get_host_info(options.ip, virt) + status, host_inst = get_host_info(options.ip, virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + + host_cn = host_inst.CreationClassName + host_sys = host_inst.Name + try: assoc_cn = get_typed_class(virt, "HostedResourcePool") pool = assoc.AssociatorNames(options.ip, @@ -62,11 +65,8 @@ logger.error("System association failed") return FAIL elif len(pool) == 0: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("No pool returned") - return FAIL + logger.error("No pool returned") + return FAIL mpool = get_typed_class(virt, 'MemoryPool') exp_pllist = { mpool : ['MemoryPool/0'] } diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Fri Nov 14 15:30:51 2008 -0800 @@ -40,10 +40,13 @@ status = PASS keys = ['Name', 'CreationClassName'] - status, host_sys, host_cn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + + host_cn = host_inst.CreationClassName + host_sys = host_inst.Name assoc_cn = get_typed_class(options.virt, "HostedResourcePool") proc_cn = get_typed_class(options.virt, "ProcessorPool") diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py Fri Nov 14 15:30:51 2008 -0800 @@ -29,11 +29,10 @@ from XenKvmLib.common_util import try_assoc from CimTest import Globals from CimTest.Globals import logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.const import do_main from XenKvmLib.classes import get_typed_class -bug = "00007" expr_values = { "invalid_ccname" : {"rc" : pywbem.CIM_ERR_NOT_FOUND, "desc" : "No such instance (CreationClassName)"}, @@ -46,7 +45,7 @@ def main(): options = main.options keys = ['Name', 'CreationClassName'] - status, host_sys, host_cn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL @@ -54,27 +53,28 @@ conn = assoc.myWBEMConnection('http://%s' % options.ip, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) - classname = host_cn + host_cn = host_inst.CreationClassName + host_sys = host_inst.Name + + if (host_cn == "Linux_ComputerSystem"): + sblim_rc = pywbem.CIM_ERR_INVALID_PARAMETER + expr_values['invalid_ccname'] = {"rc" : sblim_rc, "desc" : "wrong"} + expr_values['invalid_name'] = {"rc" : sblim_rc, "desc" : "wrong"} + assoc_classname = get_typed_class(options.virt, "HostedResourcePool") keys = {"Name" : host_sys, "CreationClassName" : "wrong"} - ret = try_assoc(conn, classname, assoc_classname, keys, + ret = try_assoc(conn, host_cn, assoc_classname, keys, "Name", expr_values['invalid_ccname'], bug_no="") if ret != PASS: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid CreationClassName Key Value.------") - return FAIL + logger.error("------FAILED: Invalid CreationClassName Key Value.------") + return FAIL keys = {"Name" : "wrong", "CreationClassName" : host_cn} - ret = try_assoc(conn, classname, assoc_classname, keys, + ret = try_assoc(conn, host_cn, assoc_classname, keys, "CreationClassName", expr_values['invalid_name'], bug_no="") if ret != PASS: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid Name Key Value.------") - return FAIL + logger.error("------ FAILED: Invalid Name Key Value.------") + return FAIL return PASS if __name__ == "__main__":

Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705451 28800 # Node ID 5f39bb761dcb4526e8b43fb6a89a3a7e61589fb1 # Parent 5466028a80608d44d61b06c3e38d5ef395cad169 [TEST] Update HostedResourcePool tests to expect instance from get_host_info().
Also remove XFAILs as these tests should pass now.
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:51 2008 -0800
This tc fails with the sblim-base-provider installed: -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: FAIL ERROR - No pool returned CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
@@ -31,21 +31,24 @@ from XenKvmLib.const import default_network_name from CimTest import Globals from CimTest.Globals import logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.const import do_main, default_pool_name from XenKvmLib.classes import get_typed_class
-bug = '00007' sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @do_main(sup_types) def main(): options = main.options virt = options.virt keys = ['Name', 'CreationClassName'] - status, host_sys, host_cn = get_host_info(options.ip, virt) + status, host_inst = get_host_info(options.ip, virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + + host_cn = host_inst.CreationClassName + host_sys = host_inst.Name + try: assoc_cn = get_typed_class(virt, "HostedResourcePool") pool = assoc.AssociatorNames(options.ip, @@ -62,11 +65,8 @@ logger.error("System association failed") return FAIL elif len(pool) == 0: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("No pool returned") - return FAIL + logger.error("No pool returned") + return FAIL
mpool = get_typed_class(virt, 'MemoryPool') exp_pllist = { mpool : ['MemoryPool/0'] } diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Fri Nov 14 15:30:51 2008 -0800 @@ -40,10 +40,13 @@ status = PASS
keys = ['Name', 'CreationClassName'] - status, host_sys, host_cn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + + host_cn = host_inst.CreationClassName + host_sys = host_inst.Name
assoc_cn = get_typed_class(options.virt, "HostedResourcePool") proc_cn = get_typed_class(options.virt, "ProcessorPool") diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py Fri Nov 14 15:30:51 2008 -0800 @@ -29,11 +29,10 @@ from XenKvmLib.common_util import try_assoc from CimTest import Globals from CimTest.Globals import logger -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.const import do_main from XenKvmLib.classes import get_typed_class
-bug = "00007" expr_values = { "invalid_ccname" : {"rc" : pywbem.CIM_ERR_NOT_FOUND, "desc" : "No such instance (CreationClassName)"}, @@ -46,7 +45,7 @@ def main(): options = main.options keys = ['Name', 'CreationClassName'] - status, host_sys, host_cn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL @@ -54,27 +53,28 @@ conn = assoc.myWBEMConnection('http://%s' % options.ip, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) - classname = host_cn + host_cn = host_inst.CreationClassName + host_sys = host_inst.Name + + if (host_cn == "Linux_ComputerSystem"): + sblim_rc = pywbem.CIM_ERR_INVALID_PARAMETER + expr_values['invalid_ccname'] = {"rc" : sblim_rc, "desc" : "wrong"} + expr_values['invalid_name'] = {"rc" : sblim_rc, "desc" : "wrong"} + assoc_classname = get_typed_class(options.virt, "HostedResourcePool") keys = {"Name" : host_sys, "CreationClassName" : "wrong"} - ret = try_assoc(conn, classname, assoc_classname, keys, + ret = try_assoc(conn, host_cn, assoc_classname, keys, "Name", expr_values['invalid_ccname'], bug_no="") if ret != PASS: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid CreationClassName Key Value.------") - return FAIL + logger.error("------FAILED: Invalid CreationClassName Key Value.------") + return FAIL
keys = {"Name" : "wrong", "CreationClassName" : host_cn} - ret = try_assoc(conn, classname, assoc_classname, keys, + ret = try_assoc(conn, host_cn, assoc_classname, keys, "CreationClassName", expr_values['invalid_name'], bug_no="") if ret != PASS: - if host_cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug) - else: - logger.error("------ FAILED: Invalid Name Key Value.------") - return FAIL + logger.error("------ FAILED: Invalid Name Key Value.------") + return FAIL
return PASS if __name__ == "__main__":
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

Deepti B Kalakeri wrote:
Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705451 28800 # Node ID 5f39bb761dcb4526e8b43fb6a89a3a7e61589fb1 # Parent 5466028a80608d44d61b06c3e38d5ef395cad169 [TEST] Update HostedResourcePool tests to expect instance from get_host_info().
Also remove XFAILs as these tests should pass now.
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:51 2008 -0800
This tc fails with the sblim-base-provider installed: -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: FAIL ERROR - No pool returned CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
This looks like a registration issue. Can you run: wbemcli ecn http://@localhost:5988/root/cimv2:KVM_HostedResourcePool If this fails for you, you'll need to be sure to uninstall the providers and then run "sudo make preinstall". Then restart Pegasus and reinstall the providers. The Pegasus repository on my system had some issues, so I had to remove the repository directory, remove Pegasus, and then reinstall Pegasus / sblim-cmpi-base. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

Kaitlin Rupert wrote:
Deepti B Kalakeri wrote:
Kaitlin Rupert wrote:
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705451 28800 # Node ID 5f39bb761dcb4526e8b43fb6a89a3a7e61589fb1 # Parent 5466028a80608d44d61b06c3e38d5ef395cad169 [TEST] Update HostedResourcePool tests to expect instance from get_host_info().
Also remove XFAILs as these tests should pass now.
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r 5466028a8060 -r 5f39bb761dcb suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:50 2008 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Nov 14 15:30:51 2008 -0800 This tc fails with the sblim-base-provider installed:
HostedResourcePool - 01_forward.py: FAIL ERROR - No pool returned CIM_ERR_INVALID_PARAMETER: Xen_HostedResourcePool --------------------------------------------------------------------
This looks like a registration issue. Can you run:
wbemcli ecn http://@localhost:5988/root/cimv2:KVM_HostedResourcePool
If this fails for you, you'll need to be sure to uninstall the providers and then run "sudo make preinstall". Then restart Pegasus and reinstall the providers.
The Pegasus repository on my system had some issues, so I had to remove the repository directory, remove Pegasus, and then reinstall Pegasus / sblim-cmpi-base.
yes this was because of the provider registration problem. This passes now. Thanks and Regards, Deepti.

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705452 28800 # Node ID 8d5eb7acc2dab6eda1fb15bf695bae4a090a5816 # Parent 5f39bb761dcb4526e8b43fb6a89a3a7e61589fb1 [TEST] Update ElementCapabilties tests to expect instance from get_host_info(). Also remove XFAILs as these tests should pass now. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 5f39bb761dcb -r 8d5eb7acc2da suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Fri Nov 14 15:30:51 2008 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Fri Nov 14 15:30:52 2008 -0800 @@ -29,14 +29,13 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES from XenKvmLib.const import do_main -from CimTest.ReturnCodes import PASS, FAIL, SKIP, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.enumclass import EnumInstances from XenKvmLib.common_util import get_host_info from XenKvmLib.const import get_provider_version sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] test_dom = "dom_elecap" -bug_sblim = "00007" libvirtcim_crsc_changes = 723 def append_to_list(server, virt, poolname, valid_elc_id): @@ -66,10 +65,13 @@ server = options.ip virt = options.virt - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Failed to get host info") return status + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name try: an = get_typed_class(virt, "ElementCapabilities") @@ -101,10 +103,7 @@ if len(elc) == 0: logger.error("'%s' association failed, expected at least one instance", an) - if host_ccn == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim) - else: - return FAIL + return FAIL for i in elc: if i.classname not in valid_elc_name: diff -r 5f39bb761dcb -r 8d5eb7acc2da suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Fri Nov 14 15:30:51 2008 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Fri Nov 14 15:30:52 2008 -0800 @@ -119,10 +119,13 @@ cap_list = {"VirtualSystemManagementCapabilities" : "ManagementCapabilities", "VirtualSystemMigrationCapabilities" : "MigrationCapabilities"} - status, host_name, host_ccn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: logger.error("Failed to get host info") return status + + host_ccn = host_inst.CreationClassName + host_name = host_inst.Name for k, v in cap_list.iteritems(): cn = get_typed_class(options.virt, k) diff -r 5f39bb761dcb -r 8d5eb7acc2da suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Fri Nov 14 15:30:51 2008 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Fri Nov 14 15:30:52 2008 -0800 @@ -54,10 +54,9 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES from XenKvmLib.const import do_main -from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] -bug_sblim = '00007' def print_err(err, detail, cn): logger.error(err % cn) @@ -92,12 +91,9 @@ CreationClassName = cn, Name = name) if len(assoc_info) < 1: - if cn == 'Linux_ComputerSystem': - return XFAIL_RC(bug_sblim), assoc_info - else: - logger.error("%s returned %i %s objects", an, - len(assoc_info), qcn) - return FAIL, assoc_info + logger.error("%s returned %i %s objects", an, + len(assoc_info), qcn) + return FAIL, assoc_info except Exception, detail: print_err(CIM_ERROR_ASSOCIATORNAMES, detail, cn) status = FAIL @@ -192,14 +188,14 @@ } # Get the host info - status, host_name, classname = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: return status an = get_typed_class(virt, 'HostedService') - cn = classname + cn = host_inst.CreationClassName qcn = 'Service' - name = host_name + name = host_inst.Name # Get the service available on the host status, service_assoc_info = get_assoc_info(server, cn, an, qcn, name) if status != PASS or len(service_assoc_info) == 0:

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705922 28800 # Node ID 948d7dc5b2acdb9f95af95e933eb1a9b07b6337f # Parent 8d5eb7acc2dab6eda1fb15bf695bae4a090a5816 [TEST] Update ETCP tests to expect instance from get_host_info(). For EC 01, make sure namespace is set as interop only after EnumInstances() for the result classes have been called. Cleanup XFAIL logic. Also, handle __iter__, __repr__, and items functions in enumclass.py for Cimtest instances. This allows for printing for Cimtest instances without encountering an error. Also allows the caller to call inst.items() to get a list of instance properties - the same that can be done with instances of type CIMInstance. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 8d5eb7acc2da -r 948d7dc5b2ac suites/libvirt-cim/cimtest/ElementConforms/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Fri Nov 14 15:30:52 2008 -0800 +++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Fri Nov 14 15:38:42 2008 -0800 @@ -43,7 +43,7 @@ from XenKvmLib.classes import get_typed_class from XenKvmLib import vxml from CimTest import Globals -from XenKvmLib.common_util import print_field_error, check_sblim, get_host_info +from XenKvmLib.common_util import print_field_error, get_host_info from CimTest.Globals import logger, CIM_ERROR_ENUMERATE from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import PASS, FAIL, XFAIL, XFAIL_RC @@ -65,18 +65,12 @@ "ProcessorPool", "MemoryPool"] cn_names.extend(cn_names2) - status, host_name, host_ccn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Unable to get host system instance objects") return FAIL, verify_ectp_list - #FIXME - get_host_info() should be updated to return the host instance - insts = EnumInstances(server, host_ccn, True) - if len(insts) < 1: - logger.error("Expected 1 %s instance", host_ccn) - return FAIL, verify_ectp_list - - verify_ectp_list[host_ccn] = insts + verify_ectp_list[host_inst.CreationClassName] = [host_inst] for cn_base in cn_names: cn = get_typed_class(virt, cn_base) @@ -165,19 +159,21 @@ return FAIL prev_namespace = Globals.CIM_NS - Globals.CIM_NS = 'root/interop' + verify_ectp_list = {} try: + status, verify_ectp_list = init_vs_pool_values(server, virt) + if status != PASS: + raise Exception("Failed to get instances needed for verification") + + Globals.CIM_NS = 'root/interop' + reg_classname = get_typed_class(virt, "RegisteredProfile") an = get_typed_class(virt,"ElementConformsToProfile") status, prof_inst_lst = get_proflist(server, reg_classname, virt) if status != PASS: raise Exception("Failed to get profile list") - - status, verify_ectp_list = init_vs_pool_values(server, virt) - if status != PASS: - raise Exception("Failed to get instances needed for verification") for prof_id in prof_inst_lst: logger.info("Verifying '%s' with '%s'", an, prof_id) @@ -187,14 +183,8 @@ InstanceID = prof_id) if len(assoc_info) < 1: - ret_val, linux_cs = check_sblim(server, virt) - if ret_val != PASS: - status = FAIL - raise Exception(" '%s' returned (%d) '%s' objects" % \ - (len(assoc_info), reg_classname)) - else: - status = XFAIL_RC(bug_sblim) - raise Exception("Known failure") + raise Exception(" '%s' returned (%d) '%s' objects" % \ + (an, len(assoc_info), reg_classname)) for inst in assoc_info: status, verify_ectp_list = verify_fields(inst, verify_ectp_list) @@ -214,6 +204,10 @@ Globals.CIM_NS = prev_namespace cxml.destroy(server) cxml.undefine(server) + + if "Linux_ComputerSystem" in verify_ectp_list: + return XFAIL_RC(bug_sblim) + return status if __name__ == "__main__": diff -r 8d5eb7acc2da -r 948d7dc5b2ac suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Fri Nov 14 15:30:52 2008 -0800 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Fri Nov 14 15:38:42 2008 -0800 @@ -109,17 +109,19 @@ inst_list[cs.CreationClassName] = cs.Name try: - status, host_name, classname = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: logger.error("Unable to get host information") cxml.undefine(server) return status + + except Exception, details: logger.error("DEBUG Exception: %s" % details) cxml.undefine(server) return FAIL - inst_list[classname] = host_name + inst_list[host_inst.CreationClassName] = host_inst.Name prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' diff -r 8d5eb7acc2da -r 948d7dc5b2ac suites/libvirt-cim/lib/XenKvmLib/enumclass.py --- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Nov 14 15:30:52 2008 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Nov 14 15:38:42 2008 -0800 @@ -50,6 +50,14 @@ CIM_Instance.__init__(self, inst) def __invoke(self, method, params): + if method == "__iter__" or method == "items": + return self.inst.items() + if method == "__repr__": + items = "" + for item in self.inst.items(): + items += "('%s' %s)," % item + return items.rstrip(",") + try: return self.conn.InvokeMethod(method, self.ref, @@ -63,6 +71,7 @@ return self.inst[attr] else: return CimExt._Method(self.__invoke, attr) + def EnumNames(host, cn): '''Resolve the enumeration given the @cn.

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1226705922 28800 # Node ID ce6191aeebc7e856eb0aa2d563a2127579950d24 # Parent 948d7dc5b2acdb9f95af95e933eb1a9b07b6337f [TEST] Update misc tests to expect instance from get_host_info(). Updates for: RPCS, VSSS, CRS Also remove XFAILs as these tests should pass now. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 948d7dc5b2ac -r ce6191aeebc7 suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py --- a/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Fri Nov 14 15:38:42 2008 -0800 +++ b/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Fri Nov 14 15:38:42 2008 -0800 @@ -55,9 +55,12 @@ "hence skipping the tc ....") return SKIP - status, host_name, host_cn = get_host_info(server, virt) + status, host_inst = get_host_info(server, virt) if status != PASS: return status + + host_cn = host_inst.CreationClassName + host_name = host_inst.Name cname = 'ConsoleRedirectionService' classname = get_typed_class(virt, cname) diff -r 948d7dc5b2ac -r ce6191aeebc7 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Fri Nov 14 15:38:42 2008 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Fri Nov 14 15:38:42 2008 -0800 @@ -40,10 +40,13 @@ server = options.ip classname = get_typed_class(options.virt, "ResourcePoolConfigurationService") keys = ['Name', 'CreationClassName'] - status, host_sys, host_cn = get_host_info(server, options.virt) + status, host_inst = get_host_info(server, options.virt) if status != PASS: logger.error("Error in calling get_host_info function") return FAIL + + host_cn = host_inst.CreationClassName + host_sys = host_inst.Name try: rpcservice = rpcs.enumerate(server, classname) diff -r 948d7dc5b2ac -r ce6191aeebc7 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Fri Nov 14 15:38:42 2008 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Fri Nov 14 15:38:42 2008 -0800 @@ -29,7 +29,6 @@ import pywbem from CimTest.ReturnCodes import PASS from XenKvmLib import assoc -from XenKvmLib.common_util import check_sblim from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS from XenKvmLib.common_util import get_host_info, try_getinstance from XenKvmLib.const import do_main @@ -238,15 +237,14 @@ conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) virt = options.virt - status, linux_cs = check_sblim(options.ip, options.virt) - if status == PASS: - hostname = linux_cs.Name - sccname = linux_cs.CreationClassName - else: - status, hostname, sccname = get_host_info(server, virt) - if status != PASS: - logger.error("Problem getting host information") - return status + status, host_inst = get_host_info(server, virt) + if status != PASS: + logger.error("Problem getting host information") + return status + + sccname = host_inst.CreationClassName + hostname = host_inst.Name + classname = get_typed_class(virt, 'ResourcePoolConfigurationService') ret_value = err_invalid_ccname_keyname(conn, classname, hostname, sccname, \ field='INVALID_CCName_KeyName') diff -r 948d7dc5b2ac -r ce6191aeebc7 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Fri Nov 14 15:38:42 2008 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py Fri Nov 14 15:38:42 2008 -0800 @@ -23,7 +23,6 @@ # Date: 25-03-2008 import sys from XenKvmLib import enumclass -from XenKvmLib.common_util import check_sblim from CimTest.Globals import CIM_ERROR_ENUMERATE, logger from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.const import do_main @@ -41,14 +40,13 @@ # Expected results from enumeration cn = get_typed_class(options.virt, "VirtualSystemSnapshotService") Name = 'SnapshotService' - status, linux_cs = check_sblim(options.ip, options.virt) - if status == PASS: - host_name = linux_cs.Name - classname = linux_cs.CreationClassName - else: - status, host_name, classname = get_host_info(options.ip, options.virt) - if status != PASS: - return status + status, host_inst = get_host_info(options.ip, options.virt) + if status != PASS: + return status + + classname = host_inst.CreationClassName + host_name = host_inst.Name + try: vs_sservice = enumclass.EnumNames(options.ip, cn) except Exception, detail: diff -r 948d7dc5b2ac -r ce6191aeebc7 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py Fri Nov 14 15:38:42 2008 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/02_vs_sservice_gi_errs.py Fri Nov 14 15:38:42 2008 -0800 @@ -28,7 +28,6 @@ import sys import pywbem from XenKvmLib import assoc -from XenKvmLib.common_util import check_sblim from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS from CimTest.ReturnCodes import PASS from XenKvmLib.common_util import try_getinstance @@ -232,14 +231,13 @@ conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS) ccn = get_typed_class(options.virt, "VirtualSystemSnapshotService") name = "SnapshotService" - status, linux_cs = check_sblim(options.ip, options.virt) - if status == PASS: - sys_name = linux_cs.Name - sccn = linux_cs.CreationClassName - else: - status, sys_name, sccn = get_host_info(options.ip, options.virt) + status, host_inst = get_host_info(options.ip, options.virt) if status != PASS: return status + + sccn = host_inst.CreationClassName + sys_name = host_inst.Name + field = 'INVALID_CCName' status = err_invalid_ccname() if status != PASS:
participants (2)
-
Deepti B Kalakeri
-
Kaitlin Rupert