# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1223359324 25200
# Node ID d81c2122fff796c7a08eb45cfe679f2e690e27bf
# Parent 311bf6eda3786eb8e47ede06c4da6dc1570aff61
[TEST] Fix HostedResourcePool/01_forward.py to work with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 311bf6eda378 -r d81c2122fff7
suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Sun Oct 05 23:56:40 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Mon Oct 06 23:02:04 2008
-0700
@@ -26,13 +26,15 @@ 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
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
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():
@@ -40,19 +42,17 @@ def main():
status = FAIL
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)
+ 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
try:
assoc_cn = get_typed_class(options.virt, "HostedResourcePool")
pool = assoc.AssociatorNames(options.ip,
assoc_cn,
- host_sys.CreationClassName,
- Name = host_sys.Name,
- CreationClassName = host_sys.CreationClassName)
+ host_cn,
+ Name = host_sys,
+ CreationClassName = host_cn)
except Exception, details:
logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % assoc_cn)
logger.error("Exception:", details)
@@ -62,8 +62,11 @@ def main():
logger.error("System association failed")
return FAIL
elif len(pool) == 0:
- logger.error("No pool returned")
- return FAIL
+ if host_cn == 'Linux_ComputerSystem':
+ return XFAIL_RC(bug)
+ else:
+ logger.error("No pool returned")
+ return FAIL
for items in pool:
cname = items.classname