# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1224146298 25200
# Node ID dd9065d32ce97c688cf09ce6ed4df1a477fd136b
# Parent 4ad371d62e4073f07958e9c5bf521ad4c1a6c32f
[TEST] Updating 05_hostsystem_cap.py tc of EC to work with/without sblim-base-provider.
Tested with Xen, XenFV, KVM with current sources, with/without sblim-base-provider.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 4ad371d62e40 -r dd9065d32ce9
suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Thu Oct 16
01:12:50 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Thu Oct 16
01:38:18 2008 -0700
@@ -54,9 +54,10 @@
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES
from XenKvmLib.const import do_main
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+bug_sblim = '00007'
def print_err(err, detail, cn):
logger.error(err % cn)
@@ -81,7 +82,7 @@
return status, inst
-def get_assoc_info(server, cn, an, qcn, name, virt="Xen"):
+def get_assoc_info(server, cn, an, qcn, name):
status = PASS
assoc_info = []
try:
@@ -89,10 +90,14 @@
an,
cn,
CreationClassName = cn,
- Name = name,)
+ Name = name)
if len(assoc_info) < 1:
- logger.error("%s returned %i %s objects" % (an, len(assoc_info),
qcn))
- status = FAIL
+ if cn == 'Linux_ComputerSystem':
+ return XFAIL_RC(bug_sblim), assoc_info
+ else:
+ logger.error("%s returned %i %s objects", an,
+ len(assoc_info), qcn)
+ return FAIL, assoc_info
except Exception, detail:
print_err(CIM_ERROR_ASSOCIATORNAMES, detail, cn)
status = FAIL
@@ -116,7 +121,7 @@
SystemCreationClassName=sccname,
SystemName=sname)
if len(assoc_info) < 1:
- logger.error("%s returned %i %s objects" % (an, len(assoc_info),
qcn))
+ logger.error("%s returned %i %s objects", an, len(assoc_info),
qcn)
status = FAIL
except Exception, detail:
@@ -143,8 +148,8 @@
cn = service_list[service_fieldname]['CreationClassName']
an = get_typed_class(virt, 'ElementCapabilities')
qcn = 'Capabilities'
- status, cap_assoc_info = get_association_info(server, service_fieldname, \
- cn, an, qcn, virt)
+ status, cap_assoc_info = get_association_info(server, service_fieldname,
+ cn, an, qcn, virt)
if status != PASS or len(cap_assoc_info) == 0:
return status
cn = cap_assoc_info[0].classname
@@ -163,37 +168,40 @@
def main():
options = main.options
server = options.ip
+ virt = options.virt
global service_list
global cap_list
# initialising the list
- service_list = { 'ManagementService' : 'Management Service', \
+ service_list = { 'ManagementService' : 'Management Service',
'MigrationService' : 'MigrationService'
}
# This will be used for the comparison at the end.
- mgtcap = { 'ClassName' : get_typed_class(options.virt,
'VirtualSystemManagementCapabilities'), \
+ vsmancap_cn = get_typed_class(virt, 'VirtualSystemManagementCapabilities')
+ vsmigcap_cn = get_typed_class(virt, 'VirtualSystemMigrationCapabilities')
+ mgtcap = { 'ClassName' : vsmancap_cn,
'InstanceID' : 'ManagementCapabilities'
}
- migcap = { 'ClassName' : get_typed_class(options.virt,
'VirtualSystemMigrationCapabilities'), \
+ migcap = { 'ClassName' : vsmigcap_cn,
'InstanceID' : 'MigrationCapabilities'
}
cap_list = {
- 'ManagementCapabilities' : mgtcap, \
+ 'ManagementCapabilities' : mgtcap,
'MigrationCapabilities' : migcap
}
# Get the host info
- status, host_name, classname = get_host_info(server, options.virt)
+ status, host_name, classname = get_host_info(server, virt)
if status != PASS:
return status
- an = get_typed_class(options.virt, 'HostedService')
+ an = get_typed_class(virt, 'HostedService')
cn = classname
qcn = 'Service'
name = host_name
# Get the service available on the host
- status, service_assoc_info = get_assoc_info(server, cn, an, qcn, name, options.virt)
+ status, service_assoc_info = get_assoc_info(server, cn, an, qcn, name)
if status != PASS or len(service_assoc_info) == 0:
return status
@@ -212,7 +220,7 @@
# Query ElementCapabilities and verify the ManagementCapabilities information.
service_fieldname = 'ManagementService'
cap_key = 'ManagementCapabilities'
- status = verify_cap_fields(server, service_fieldname, cap_key, options.virt)
+ status = verify_cap_fields(server, service_fieldname, cap_key, virt)
if status != PASS:
logger.error("ManagementCapabilities Verification failed")
return status
@@ -220,7 +228,7 @@
# Query ElementCapabilities and verify the MigrationCapabilities information.
service_fieldname = 'MigrationService'
cap_key = 'MigrationCapabilities'
- status = verify_cap_fields(server, service_fieldname, cap_key, options.virt)
+ status = verify_cap_fields(server, service_fieldname, cap_key, virt)
if status != PASS:
logger.error("MigrationCapabilities Verification failed")
return status