# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223516805 25200
# Node ID fb1e4aac03bb7c31ad393080fa84b355231f6127
# Parent 285bc0174fb36512228e1cfcaba2186a0aa112c5
[TEST]#2 Fix HostedResourcePool/02_reverse.py to work with sblim cmpi base provider
installed
Updates from 1 to 2:
Chage error description in log error
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 285bc0174fb3 -r fb1e4aac03bb
suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Wed Oct 08 03:03:37 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Wed Oct 08 18:46:45 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")
@@ -61,13 +61,13 @@ def main():
try:
assoc_host = assoc.AssociatorNames(options.ip, assoc_cn, k, InstanceID = v)
except Exception:
- logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % v)
+ 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: