# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222313124 25200
# Node ID 6f009d69469751477d8c3a91a37109a418e69412
# Parent 375ae129b8e910fe42a5e4434b67ada5589bc72f
[TEST] #2 Fix ResourcePoolConfigurationService.01&02 to work with sblim base provider
installed and without
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 375ae129b8e9 -r 6f009d694697
suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Tue Sep 23
04:45:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Wed Sep 24
20:25:24 2008 -0700
@@ -25,6 +25,7 @@ import sys
import sys
from XenKvmLib import enumclass
from XenKvmLib import rpcs
+from XenKvmLib.common_util import check_sblim
from CimTest import Globals
from CimTest.ReturnCodes import PASS, FAIL
from CimTest.Globals import logger
@@ -39,12 +40,16 @@ def main():
server = options.ip
classname = get_typed_class(options.virt,
"ResourcePoolConfigurationService")
keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(server, '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, linux_cs = check_sblim(options.ip, options.virt)
+ if status == PASS:
+ host_sys = linux_cs
+ else:
+ try:
+ host_sys = enumclass.enumerate(server, '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
try:
rpcservice = rpcs.enumerate(server, classname)
diff -r 375ae129b8e9 -r 6f009d694697
suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py
---
a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Tue Sep
23 04:45:04 2008 -0700
+++
b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Wed Sep
24 20:25:24 2008 -0700
@@ -29,6 +29,7 @@ import pywbem
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
@@ -237,10 +238,15 @@ def main():
conn = assoc.myWBEMConnection('http://%s' % options.ip,
(CIM_USER, CIM_PASS), CIM_NS)
virt = options.virt
- status, hostname, sccname = get_host_info(server, virt)
- if status != PASS:
- logger.error("Problem getting host information")
- return status
+ 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
classname = get_typed_class(virt, 'ResourcePoolConfigurationService')
ret_value = err_invalid_ccname_keyname(conn, classname, hostname, sccname, \
field='INVALID_CCName_KeyName')
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim