
yunguol@cn.ibm.com wrote:
# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1223359792 25200 # Node ID 0b599308e31a1865ab47b1c2d44d0887c409e139 # Parent 311bf6eda3786eb8e47ede06c4da6dc1570aff61 [TEST] Fix HostedResourcePool/02_reverse.py to work with sblim cmpi base provider installed
Signed-off-by: Guolian Yun <yunguol@cn.ibm.com>
diff -r 311bf6eda378 -r 0b599308e31a suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Sun Oct 05 23:56:40 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Mon Oct 06 23:09:52 2008 -0700 @@ -25,6 +25,7 @@ import sys import sys from XenKvmLib import assoc from XenKvmLib import enumclass +from XenKvmLib.common_util import get_host_info from XenKvmLib.const import default_network_name from CimTest import Globals from CimTest.Globals import logger @@ -39,12 +40,11 @@ def main(): status = PASS
keys = ['Name', 'CreationClassName'] - try: - host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0] - except Exception: - host_cn = get_typed_class(options.virt, "HostSystem") - logger.error(Globals.CIM_ERROR_ENUMERATE % host_cn) - return FAIL + status, host_sys, host_cn = get_host_info(options.ip, options.virt) + if status != PASS: + logger.error("Error in calling get_host_info function") + return FAIL + assoc_cn = get_typed_class(options.virt, "HostedResourcePool") proc_cn = get_typed_class(options.virt, "ProcessorPool") mem_cn = get_typed_class(options.virt, "MemoryPool") @@ -64,10 +64,10 @@ def main(): logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % v)
This should be logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % assoc_cn)
return FAIL if len(assoc_host) == 1: - if assoc_host[0].keybindings['Name'] != host_sys.Name: + if assoc_host[0].keybindings['Name'] != host_sys: logger.error("Pool association returned wrong hostsystem") status = FAIL - if assoc_host[0].keybindings['CreationClassName'] != host_sys.CreationClassName: + if assoc_host[0].keybindings['CreationClassName'] != host_cn: logger.error("Pool association returned wrong CreationClassName") status = FAIL if status != PASS:
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim