# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1225801400 28800
# Node ID 302c90a9915261a1aebe6e0f20785cb8ccf3caaf
# Parent e0860bbf3ed4cf3d4adb20b5de805ec5ca8818be
[TEST] Updating 02_reverse.py tc of HostedService.
Updating 02_reverse.py tc of HostedService to include CRS provider information
when the libvirt_cim_revision >= 695.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r e0860bbf3ed4 -r 302c90a99152
suites/libvirt-cim/cimtest/HostedService/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Tue Nov 04 03:47:46 2008
-0800
+++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Tue Nov 04 04:23:20 2008
-0800
@@ -31,20 +31,28 @@
from CimTest.Globals import logger
from CimTest.ReturnCodes import PASS, FAIL, XFAIL
from XenKvmLib.common_util import get_host_info
+from XenKvmLib.const import get_provider_version
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+libvirtcim_hr_crs_changes = 695
@do_main(sup_types)
def main():
options = main.options
+ server = options.ip
virt = options.virt
servicelist = {"ResourcePoolConfigurationService" : "RPCS",
"VirtualSystemManagementService" : "Management
Service",
- "VirtualSystemMigrationService" :
"MigrationService",
- "ConsoleRedirectionService" :
"ConsoleRedirectionService" }
+ "VirtualSystemMigrationService" :
"MigrationService"}
- status, host_name, host_ccn = get_host_info(options.ip, virt)
+ # This check is required for libivirt-cim providers which do not have
+ # CRS changes in it and the CRS provider is available with revision >= 695.
+ cim_rev, changeset = get_provider_version(virt, server)
+ if cim_rev >= libvirtcim_hr_crs_changes:
+ servicelist['ConsoleRedirectionService'] =
"ConsoleRedirectionService"
+
+ status, host_name, host_ccn = get_host_info(server, virt)
if status != PASS:
logger.error("Failed to get host info.")
return status
@@ -53,7 +61,7 @@
for k, v in servicelist.iteritems():
cn = get_typed_class(virt, k)
try:
- assoc_host = assoc.AssociatorNames(options.ip, an, cn,
+ assoc_host = assoc.AssociatorNames(server, an, cn,
Name = v,
CreationClassName = cn,
SystemCreationClassName = host_ccn,
@@ -63,7 +71,7 @@
return FAIL
if len(assoc_host) != 1:
- logger.error("Too many hosts")
+ logger.error("'%s' association failed", an)
return FAIL
ccn = assoc_host[0].keybindings['CreationClassName']