+1 for me.
It will be good if you can restrict the lines to 80 columns.
yunguol(a)cn.ibm.com wrote:
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222240437 25200
# Node ID 7c2de8fcf22951325f1bbcf67bd73b7f8cee871d
# Parent d2ae228a60c34b78c3dd1e4f43f6a5413898980d
[TEST] 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 d2ae228a60c3 -r 7c2de8fcf229
suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Mon Sep 22
11:28:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Wed Sep 24
00:13:57 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[0]
+ 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 d2ae228a60c3 -r 7c2de8fcf229
suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py
---
a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Mon Sep
22 11:28:02 2008 -0700
+++
b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/02_rcps_gi_errors.py Wed Sep
24 00:13:57 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[0].Name
+ sccname = linux_cs[0].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