# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222422572 25200
# Node ID 198c30c31203d1b2c58322732509565479b52c18
# Parent 61a90c7c9141a64af825e6d4e5645723879df078
[TEST] Fix HostedService-02_reverse.py with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 61a90c7c9141 -r 198c30c31203
suites/libvirt-cim/cimtest/HostedService/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Wed Sep 24 20:27:48 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Sep 26 02:49:32 2008
-0700
@@ -25,6 +25,7 @@ from VirtLib import utils
from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import check_sblim
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from XenKvmLib.const import do_main
@@ -36,12 +37,16 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC
@do_main(sup_types)
def main():
options = main.options
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
- return FAIL
+ ret, linux_cs = check_sblim(options.ip, options.virt)
+ if ret == PASS:
+ host_sys = linux_cs
+ else:
+ keys = ['Name', 'CreationClassName']
+ try:
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
+ except Exception:
+ logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
+ return FAIL
servicelist = {"ResourcePoolConfigurationService" : "RPCS",
"VirtualSystemManagementService" : "Management
Service",
"VirtualSystemMigrationService" :
"MigrationService"}
@@ -67,7 +72,8 @@ def main():
ccn = assoc_host[0].keybindings['CreationClassName']
name = assoc_host[0].keybindings['Name']
- if ccn != get_typed_class(options.virt, "HostSystem"):
+ if ccn != get_typed_class(options.virt, "HostSystem")\
+ and ccn != 'Linux_ComputerSystem':
logger.error("CreationClassName Error")
return FAIL
elif name != host_sys.Name: