CimTest Report for KVM on F9 02-07-2008
by Deepti B Kalakeri
========================================================================
CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil
========================================================================
Distro : Fedora 9 Beta
Kernel : 2.6.25-0.121.rc5.git4.fc9
Libvirt : libvirt-0.4.2-1.fc9.x86_64
CIMOM : pegasus
PyWBEM : pywbem-0.6
CIM Schema : cimv216Experimental
LibCMPIutil : 79
LibVirtCIM : 624
CIMTEST : 235
=======================================================
PASS : 108
FAIL : 0
XFAIL : 4
SKIP : 18
-----------------
Total : 130
=======================================================
Please find the complete report attached with the mail.
Thanks and Regards,
Deepti.
Starting test suite: libvirt-cim
Cleaned log files.
Testing KVM hypervisor
AllocationCapabilities - 01_enum.py: PASS
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
ComputerSystem - 01_enum.py: PASS
ComputerSystem - 02_nosystems.py: SKIP
ERROR - System has defined domains; unable to run
ComputerSystem - 03_defineVS.py: PASS
ComputerSystem - 04_defineStartVS.py: PASS
ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 00002
ERROR - ERROR: VS DomST1 transition from Defined State to Activate state was not Successful
Bug:<00002>
ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 00002
ERROR - ERROR: VS DomST1 transition from suspend State to Activate state was not Successful
Bug:<00002>
ComputerSystem - 22_define_suspend.py: PASS
ComputerSystem - 23_suspend_suspend.py: SKIP
ComputerSystem - 27_define_suspend_errs.py: SKIP
ComputerSystem - 32_start_reboot.py: SKIP
ComputerSystem - 33_suspend_reboot.py: SKIP
ComputerSystem - 35_start_reset.py: SKIP
ComputerSystem - 40_RSC_start.py: XFAIL Bug: 00002
ERROR - RequestedState should be 2 not 12
ERROR - Exception: Attributes were not set as expected for domain: 'test_domain'
Bug:<00002>
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: PASS
ElementAllocatedFromPool - 01_forward.py: SKIP
ElementAllocatedFromPool - 02_reverse.py: SKIP
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
ElementAllocatedFromPool - 04_forward_errs.py: PASS
ElementCapabilities - 01_forward.py: PASS
ElementCapabilities - 02_reverse.py: PASS
libvir: QEMU error : Domain not found
libvir: Domain error : invalid domain pointer in virDomainFree
ElementCapabilities - 03_forward_errs.py: PASS
libvir: QEMU error : Domain not found
ElementCapabilities - 04_reverse_errs.py: PASS
ElementCapabilities - 05_hostsystem_cap.py: PASS
ElementConforms - 01_forward.py: PASS
ElementConforms - 02_reverse.py: PASS
ElementConforms - 03_ectp_fwd_errs.py: PASS
ElementConforms - 04_ectp_rev_errs.py: PASS
ElementSettingData - 01_forward.py: PASS
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS
EnabledLogicalElementCapabilities - 01_enum.py: PASS
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
HostSystem - 01_enum.py: PASS
HostSystem - 02_hostsystem_to_rasd.py: PASS
HostSystem - 03_hs_to_settdefcap.py: PASS
HostSystem - 04_hs_to_EAPF.py: SKIP
HostSystem - 05_hs_gi_errs.py: PASS
HostSystem - 06_hs_to_vsms.py: PASS
HostedDependency - 01_forward.py: PASS
HostedDependency - 02_reverse.py: PASS
HostedDependency - 03_enabledstate.py: PASS
HostedDependency - 04_reverse_errs.py: PASS
HostedResourcePool - 01_forward.py: PASS
HostedResourcePool - 02_reverse.py: PASS
HostedResourcePool - 03_forward_errs.py: PASS
HostedResourcePool - 04_reverse_errs.py: PASS
HostedService - 01_forward.py: PASS
default-kvm-dimage.2NDHostedService - 02_reverse.py: PASS
HostedService - 03_forward_errs.py: PASS
HostedService - 04_reverse_errs.py: PASS
LogicalDisk - 01_disk.py: PASS
LogicalDisk - 02_nodevs.py: SKIP
ERROR - System has defined domains; unable to run
LogicalDisk - 03_ld_gi_errs.py: PASS
Memory - 01_memory.py: PASS
Memory - 02_defgetmem.py: PASS
Memory - 03_mem_gi_errs.py: PASS
NetworkPort - 01_netport.py: PASS
NetworkPort - 02_np_gi_errors.py: PASS
NetworkPort - 03_user_netport.py: XFAIL Bug: 00004
ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (test_domain/00:11:22:33:44:55)')
Bug:<00004>
Processor - 01_processor.py: PASS
Processor - 02_definesys_get_procs.py: PASS
Processor - 03_proc_gi_errs.py: PASS
Profile - 01_enum.py: PASS
Profile - 02_profile_to_elec.py: SKIP
Profile - 03_rprofile_gi_errs.py: SKIP
RASD - 01_verify_rasd_fields.py: PASS
RASD - 02_enum.py: PASS
RASD - 03_rasd_errs.py: PASS
ReferencedProfile - 01_verify_refprof.py: PASS
ReferencedProfile - 02_refprofile_errs.py: PASS
ResourceAllocationFromPool - 01_forward.py: PASS
ResourceAllocationFromPool - 02_reverse.py: PASS
ResourceAllocationFromPool - 03_forward_errs.py: PASS
ResourceAllocationFromPool - 04_reverse_errs.py: PASS
libvir: Network error : invalid network pointer in virNetworkFree
libvir: QEMU error : Network not found: no network with matching name
libvir: Network error : invalid network pointer in virNetworkFree
ResourceAllocationFromPool - 05_RAPF_err.py: PASS
ResourcePool - 01_enum.py: PASS
ResourcePool - 02_rp_gi_errors.py: PASS
ResourcePoolConfigurationCapabilities - 01_enum.py: PASS
ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS
ResourcePoolConfigurationService - 01_enum.py: PASS
ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS
ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS
SettingsDefine - 01_forward.py: PASS
SettingsDefine - 02_reverse.py: PASS
SettingsDefine - 03_sds_fwd_errs.py: PASS
SettingsDefine - 04_sds_rev_errs.py: PASS
SettingsDefineCapabilities - 01_forward.py: PASS
SettingsDefineCapabilities - 03_forward_errs.py: PASS
SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS
SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS
SystemDevice - 01_forward.py: PASS
SystemDevice - 02_reverse.py: PASS
SystemDevice - 03_fwderrs.py: PASS
VSSD - 01_enum.py: PASS
VSSD - 02_bootldr.py: SKIP
VSSD - 03_vssd_gi_errs.py: PASS
VSSD - 04_vssd_to_rasd.py: PASS
VirtualSystemManagementCapabilities - 01_enum.py: PASS
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
VirtualSystemManagementService - 01_definesystem_name.py: PASS
VirtualSystemManagementService - 02_destroysystem.py: PASS
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
libvir: Domain error : invalid domain pointer in virDomainFree
libvir: QEMU error : Domain not found
libvir: Domain error : invalid domain pointer in virDomainFree
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
VirtualSystemManagementService - 06_addresource.py: PASS
VirtualSystemManagementService - 07_addresource_neg.py: PASS
VirtualSystemManagementService - 08_modifyresource.py: PASS
VirtualSystemManagementService - 09_procrasd_persist.py: PASS
VirtualSystemMigrationCapabilities - 01_enum.py: PASS
VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
VirtualSystemMigrationSettingData - 01_enum.py: PASS
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS
VirtualSystemSettingDataComponent - 01_forward.py: SKIP
VirtualSystemSettingDataComponent - 02_reverse.py: PASS
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS
VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS
VirtualSystemSnapshotService - 01_enum.py: PASS
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS
16 years, 5 months
[PATCH] [TEST] #2 Fix VirtualSystemSettingDataComponent - 01_forward.py failure
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214945951 25200
# Node ID 5872801b69296bac39b1b5060e6de2643471f290
# Parent ea52dde5ac3e1b10d5aa59b101d91b8ffc5b127e
[TEST] #2 Fix VirtualSystemSettingDataComponent - 01_forward.py failure.
Test was expecting one ProcRASD for each domain processor. It should expect only one RASD.
Also updated this test to use PASS/FAIL, removed global variables, and cleaned up indention.
This test will need to be updated to support other XenFV, etc.
Updates from 1 to 2:
-Fix build_vssd_info() to return FAIL in case of error, not call sys.exit().
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r ea52dde5ac3e -r 5872801b6929 suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Jul 01 13:45:25 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Tue Jul 01 13:59:11 2008 -0700
@@ -58,6 +58,7 @@
from CimTest import Globals
from XenKvmLib import assoc
from CimTest.Globals import logger, do_main
+from CimTest.ReturnCodes import FAIL, PASS
sup_types = ['Xen']
@@ -67,64 +68,49 @@
test_disk = 'xvda'
status = 0
VSType = "Xen"
-vssd_names = []
-vssd_values = []
-RASD_cllist = [
- 'Xen_DiskResourceAllocationSettingData', \
- 'Xen_MemResourceAllocationSettingData', \
- 'Xen_NetResourceAllocationSettingData', \
- 'Xen_ProcResourceAllocationSettingData'
- ]
-
def init_list():
"""
Creating the lists that will be used for comparisons.
"""
- prop_list = []
- prop_list = ["%s/%s" % (test_dom, test_disk), \
- "%s/%s" % (test_dom, "mem"), \
- "%s/%s" % (test_dom, test_mac)
- ]
- proc_list = []
- for i in range(test_vcpus):
- proc_list.append("%s/%s" % (test_dom, i))
- return prop_list, proc_list
+
+ rlist = ['Xen_DiskResourceAllocationSettingData',
+ 'Xen_MemResourceAllocationSettingData',
+ 'Xen_NetResourceAllocationSettingData',
+ 'Xen_ProcResourceAllocationSettingData'
+ ]
+
+ prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk),
+ rlist[1] : "%s/%s" % (test_dom, "mem"),
+ rlist[2] : "%s/%s" % (test_dom, test_mac),
+ rlist[3] : "%s/%s" % (test_dom, "proc")
+ }
+
+ return prop_list
def build_vssd_info(ip, vssd):
"""
Creating the vssd fileds lists that will be used for comparisons.
"""
- global vssd_names, vssd_values
if vssd.Bootloader == "" or vssd.Caption == "" or \
vssd.InstanceID == "" or vssd.ElementName == "" or \
vssd.VirtualSystemIdentifier == "" or vssd.VirtualSystemType == "":
logger.error("One of the required VSSD details seems to be empty")
- status = 1
test_domain_function(test_dom, ip, "undefine")
- sys.exit(status)
+ return FAIL
- vssd_names = [
- 'Bootloader', \
- 'Caption', \
- 'InstanceID', \
- 'ElementName', \
- 'VirtualSystemIdentifier', \
- 'VirtualSystemType', \
- ]
-
- vssd_values = [
- vssd.Bootloader, \
- vssd.Caption, \
- vssd.InstanceID, \
- vssd.ElementName, \
- vssd.VirtualSystemIdentifier, \
- vssd.VirtualSystemType, \
- ]
+ vssd_vals = {'Bootloader' : vssd.Bootloader,
+ 'Caption' : vssd.Caption,
+ 'InstanceID' : vssd.InstanceID,
+ 'ElementName' : vssd.ElementName,
+ 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier,
+ 'VirtualSystemType' : vssd.VirtualSystemType
+ }
+ return vssd_vals
-def assoc_values(ip, assoc_info, cn):
+def assoc_values(ip, assoc_info, cn, an, vals):
"""
The association info of
Xen_VirtualSystemSettingDataComponent with every RASDclass is
@@ -132,36 +118,29 @@
Caption, InstanceID, ElementName, VirtualSystemIdentifier,
VirtualSystemType, Bootloader
"""
- global status
- global vssd_names, vssd_values
try:
if len(assoc_info) != 1:
- Globals.logger.error("Xen_VirtualSystemSettingDataComponent \
-returned %i Resource objects for class '%s'", len(assoc_info),cn)
- status = 1
- return status
+ Globals.logger.error("%s returned %i resource objects for '%s'" % \
+ (an, len(assoc_info), cn))
+ return FAIL
- for idx in range(len(vssd_names)):
- if assoc_info[0][vssd_names[idx]] != vssd_values[idx]:
- Globals.logger.error("%s Mismatch", vssd_names[idx])
- Globals.logger.error("Returned %s instead of %s", \
- assoc_info[0][vssd_names[idx]], \
- vssd_fields[idx])
- status = 1
- if status != 0:
- break
+ for prop, val in vals.iteritems():
+ if assoc_info[0][prop] != val:
+ Globals.logger.error("%s mismatch: returned %s instead of %s" %\
+ (prop, assoc_info[0][prop], val))
+ return FAIL
+
+ return PASS
+
except Exception, detail :
logger.error("Exception in assoc_values function: %s" % detail)
- status = 1
- test_domain_function(test_dom, ip, "undefine")
- return status
-
+ return FAIL
@do_main(sup_types)
def main():
options = main.options
- global status
+ status = FAIL
destroy_and_undefine_all(options.ip)
test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \
@@ -171,9 +150,7 @@
ret = test_domain_function(test_xml, options.ip, cmd = "define")
if not ret:
logger.error("Failed to define the dom: %s", test_dom)
- status = 1
- return status
-
+ return FAIL
instIdval = "%s:%s" % (VSType, test_dom)
keyname = "InstanceID"
@@ -183,48 +160,39 @@
vssd = enumclass.getInstance(options.ip, \
enumclass.Xen_VirtualSystemSettingData, \
key_list)
- build_vssd_info(options.ip, vssd)
+ if vssd is None:
+ logger.error("VSSD instance for %s not found" % test_dom)
+ test_domain_function(test_dom, options.ip, "undefine")
+ return FAIL
+
+ vssd_vals = build_vssd_info(options.ip, vssd)
except Exception, detail :
logger.error(Globals.CIM_ERROR_GETINSTANCE, \
- 'Xen_VirtualSystemSettingData')
+ 'Xen_VirtualSystemSettingData')
logger.error("Exception : %s" % detail)
test_domain_function(test_dom, options.ip, "undefine")
- status = 1
- return status
+ return FAIL
- prop_list, proc_list = init_list()
+ prop_list = init_list()
try:
- idx = 0
- # Looping through the RASD_cllist, call association
- # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist
- for rasd_cname in RASD_cllist:
- if rasd_cname != 'Xen_ProcResourceAllocationSettingData':
- assoc_info = assoc.Associators(options.ip, \
- 'Xen_VirtualSystemSettingDataComponent', \
- rasd_cname, \
- InstanceID = prop_list[idx])
- # Verify the association fields returned for particular rasd_cname.
- assoc_values(options.ip, assoc_info, rasd_cname)
- idx = idx + 1
- else:
- # Xen_ProcResourceAllocationSettingData, we need to find
- # association information for all the proc InstanceID and hence
- # we loop from 0 to (test_vcpus - 1 )
- for index in range(len(proc_list)):
- assoc_info = assoc.Associators(options.ip, \
- 'Xen_VirtualSystemSettingDataComponent', \
- rasd_cname, \
- InstanceID = prop_list[index])
+ # Looping through the RASD_cllist, call association
+ # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist
+ an = 'Xen_VirtualSystemSettingDataComponent'
+ for rasd_cname, prop in prop_list.iteritems():
+ assoc_info = assoc.Associators(options.ip, an, rasd_cname,
+ InstanceID = prop)
# Verify the association fields returned for particular rasd_cname.
- assoc_values(options.ip, assoc_info, rasd_cname)
+ status = assoc_values(options.ip, assoc_info, rasd_cname, an,
+ vssd_vals)
+ if status != PASS:
+ break
except Exception, detail :
- logger.error(Globals.CIM_ERROR_ASSOCIATORS, \
- 'Xen_VirtualSystemSettingDataComponent')
+ logger.error(Globals.CIM_ERROR_ASSOCIATORS, an)
logger.error("Exception : %s" % detail)
- status = 1
+ status = FAIL
test_domain_function(test_dom, options.ip, "undefine")
return status
16 years, 5 months
[PATCH] [TEST] #2 Some VirtualSystemManagementService -t 02_destroysystem.py cleanup
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214945125 25200
# Node ID ea52dde5ac3e1b10d5aa59b101d91b8ffc5b127e
# Parent cb09fbc0900ca656f629057742f19f1771fed4f8
[TEST] #2 Some VirtualSystemManagementService -t 02_destroysystem.py cleanup.
Add checks to see if the define() / start() calls pass.
Added cleanup_env() function to destroy()/undefine() guest in case of error.
Ensure status is set to PASS only if the guest is not found in the domain list after the DestroySystem() call is made.
Updated from 1 to 2:
-Fix error message - if we are unable to start the guest, error message should say "Failed to start the dom: %s"
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r cb09fbc0900c -r ea52dde5ac3e suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Tue Jul 01 13:42:52 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Tue Jul 01 13:45:25 2008 -0700
@@ -35,47 +35,53 @@
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
default_dom = 'test_domain'
+def cleanup_env(ip, cxml):
+ cxml.destroy(ip)
+ cxml.undefine(ip)
+
@do_main(sup_types)
def main():
options = main.options
service = vsms.get_vsms_class(options.virt)(options.ip)
cxml = vxml.get_class(options.virt)(default_dom)
- cxml.define(options.ip)
- cxml.start(options.ip)
+ ret = cxml.define(options.ip)
+ if not ret:
+ logger.error("Failed to define the dom: %s", default_dom)
+ return FAIL
+ ret = cxml.start(options.ip)
+ if not ret:
+ logger.error("Failed to start the dom: %s", default_dom)
+ cleanup_env(options.ip, cxml)
+ return FAIL
classname = get_typed_class(options.virt, 'ComputerSystem')
cs_ref = CIMInstanceName(classname, keybindings = {
'Name':default_dom,
'CreationClassName':classname})
list_before = domain_list(options.ip, options.virt)
- status = PASS
- rc = -1
+ if default_dom not in list_before:
+ logger.error("Domain not in domain list")
+ cleanup_env(options.ip, cxml)
+ return FAIL
try:
service.DestroySystem(AffectedSystem=cs_ref)
- rc = 0
except Exception, details:
logger.error('Unknow exception happened')
logger.error(details)
- status = FAIL
+ cleanup_env(options.ip, cxml)
+ return FAIL
list_after = domain_list(options.ip, options.virt)
- status = PASS
- if default_dom not in list_before:
- logger.error("Domain not started, check config")
+ if default_dom in list_after:
+ logger.error("Domain %s not destroyed: provider didn't return error" % \
+ default_dom)
+ cleanup_env(options.ip, cxml)
status = FAIL
else:
- destroyed = set(list_before) - set(list_after)
- if len(destroyed) != 1:
- logger.error("Destroyed multiple domains")
- status = FAIL
- elif default_dom not in destroyed:
- logger.error("Wrong domain destroyed")
- status = FAIL
-
- cxml.undefine(options.ip)
+ status = PASS
return status
16 years, 5 months
[PATCH] [TEST] #2 A few migration related fixes
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214942997 25200
# Node ID da0aebe9e441c2a0020fad9d063c489026eee2b2
# Parent 0c3bd5f782c4776719799ad5c74226c95e70092e
[TEST] #2 A few migration related fixes.
Fixes:
-Remove destroy_and_undefine_domain() call from migrate_guest_to_host(). This call takes the domain name as a parameter, but migrate_guest_to_host() doesn't take the domain name So calling destroy_and_undefine_domain() resulted in an error.
-Add a hack to get_typed_class() so it supports Virt_MigrationJob (which doesn't fit the typical <virt>_<basename> pattern.
Updates from 1 to 2:
-Improve error catching / reporting in start_guest_get_ref()
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Fri Jun 27 09:57:11 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Tue Jul 01 13:09:57 2008 -0700
@@ -42,19 +42,26 @@
def start_guest_get_ref(ip, guest_name):
try:
xmlfile = testxml(guest_name)
- define_test_domain(xmlfile, ip)
+ ret = define_test_domain(xmlfile, ip)
+ if not ret:
+ return FAIL, None
- start_test_domain(guest_name, ip)
+ ret = start_test_domain(guest_name, ip)
+ if not ret:
+ return FAIL, None
+
time.sleep(10)
except Exception:
logger.error("Error creating domain %s" % guest_name)
- destroy_and_undefine_domain(guest_name, options.ip)
return FAIL, None
classname = 'Xen_ComputerSystem'
cs_ref = CIMInstanceName(classname, keybindings = {
'Name':guest_name,
'CreationClassName':classname})
+
+ if cs_ref is None:
+ return FAIL, None
return PASS, cs_ref
@@ -80,6 +87,7 @@
status, cs_ref = start_guest_get_ref(options.ip, dom_name)
if status != PASS:
+ destroy_and_undefine_domain(guest_name, options.ip)
return FAIL
guest_name = cs_ref['Name']
@@ -90,10 +98,10 @@
return FAIL
status, ret = migrate_guest_to_host(service, cs_ref, target_ip)
-
if status == FAIL:
logger.error("MigrateVirtualSystemToHost: unexpected list length %s"
% len(ret))
+ destroy_and_undefine_domain(dom_name, options.ip)
return status
elif len(ret) == 2:
id = ret[1]['Job'].keybindings['InstanceID']
@@ -102,7 +110,7 @@
guest_name, local_migrate)
- destroy_and_undefine_domain(dom_name, options.ip)
+ destroy_and_undefine_domain(dom_name, options.ip)
return status
diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Fri Jun 27 09:57:11 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Tue Jul 01 13:09:57 2008 -0700
@@ -145,12 +145,11 @@
logger.info("Migrating guest with the following options:")
logger.info("%s" % item)
- status, ret = migrate_guest_to_host(service, cs_ref, target_ip,
- item)
-
+ status, ret = migrate_guest_to_host(service, cs_ref, target_ip, item)
if status == FAIL:
logger.error("MigrateVirtualSystemToHost: unexpected list length %s"
% len(ret))
+ destroy_and_undefine_domain(dom_name, options.ip)
return status
elif len(ret) == 2:
id = ret[1]['Job'].keybindings['InstanceID']
diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/lib/XenKvmLib/classes.py
--- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Fri Jun 27 09:57:11 2008 +0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Tue Jul 01 13:09:57 2008 -0700
@@ -23,7 +23,8 @@
def get_typed_class(virt, basename):
if virt not in virt_types:
- raise ValueError('Invalid class type')
+ if virt != "Virt" and basename != "MigrationJob":
+ raise ValueError('Invalid class type')
if basename == None or basename == '':
raise ValueError('Invalide class base name')
diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Fri Jun 27 09:57:11 2008 +0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Tue Jul 01 13:09:57 2008 -0700
@@ -95,10 +95,10 @@
except Exception, details:
logger.error("Error invoke method 'MigrateVirtualSystemToHost\'.")
logger.error("%s", details)
+ return FAIL, ret
if len(ret) == 0:
logger.error("MigrateVirtualSystemToHost returns an empty list")
- destroy_and_undefine_domain(test_dom, ip)
return FAIL, ret
return PASS, ret
16 years, 5 months
[PATCH] Report failure to deliver indication
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1214941651 25200
# Node ID cb343a986592c25c487c53042ad889fa24ea9d97
# Parent e41428ac70e85d4cecc5fd0738680fc11de5e775
Report failure to deliver indication
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r e41428ac70e8 -r cb343a986592 src/Virt_ComputerSystemIndication.c
--- a/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:21 2008 -0700
+++ b/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:31 2008 -0700
@@ -240,8 +240,12 @@
CU_DEBUG("Delivering Indication: %s",
CMGetCharPtr(CMObjectPathToString(ind_op, NULL)));
- stdi_deliver(broker, ctx, args, ind);
- CU_DEBUG("Delivered");
+ s = stdi_deliver(broker, ctx, args, ind);
+ if (s.rc == CMPI_RC_OK) {
+ CU_DEBUG("Indication delivered");
+ } else {
+ CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg));
+ }
out:
return ret;
16 years, 5 months
[PATCH] Reduce the non-CIM cycle timer from 3 minutes to 1 minute
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1214941641 25200
# Node ID e41428ac70e85d4cecc5fd0738680fc11de5e775
# Parent 117ae7952d7264c64a3abbf236cf18758ae0200d
Reduce the non-CIM cycle timer from 3 minutes to 1 minute
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 117ae7952d72 -r e41428ac70e8 src/Virt_ComputerSystemIndication.c
--- a/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:21 2008 -0700
+++ b/src/Virt_ComputerSystemIndication.c Tue Jul 01 12:47:21 2008 -0700
@@ -56,7 +56,7 @@
static pthread_mutex_t lifecycle_mutex = PTHREAD_MUTEX_INITIALIZER;
static bool lifecycle_enabled = 0;
-#define WAIT_TIME 180
+#define WAIT_TIME 60
#define FAIL_WAIT_TIME 2
struct dom_xml {
16 years, 5 months
[PATCH] For pause, reboot, and enable add support for guests in the NOSTATE state
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214428450 25200
# Node ID bd1ee412c6853d5fd005eca535b0b04446e08fb4
# Parent edf96787c23dc7a91a008916b4b00b22fc22703a
For pause, reboot, and enable add support for guests in the NOSTATE state.
It's possible that a XenFV guest might return no state instead of blocked or running. When xend schedules to guest to run, the guest needs qemu to run (to handle device emulation). If we get the state of the guest before qemu is done running its setup, libvirt reports no state.
This should be a safe approach - we return an error if the guest is in some other state or if libvirt is unable to successfully change the state of the guest.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r edf96787c23d -r bd1ee412c685 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Wed Jun 25 12:34:09 2008 -0700
+++ b/src/Virt_ComputerSystem.c Wed Jun 25 14:14:10 2008 -0700
@@ -733,6 +733,7 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
CU_DEBUG("Pause domain");
ret = virDomainSuspend(dom);
break;
@@ -758,6 +759,7 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
CU_DEBUG("Reboot domain");
ret = virDomainReboot(dom, 0);
break;
@@ -783,6 +785,7 @@
switch (info->state) {
case VIR_DOMAIN_RUNNING:
case VIR_DOMAIN_BLOCKED:
+ case VIR_DOMAIN_NOSTATE:
CU_DEBUG("Reset domain");
ret = domain_reset(dom);
break;
16 years, 5 months
[PATCH] [TEST] Fix VirtualSystemSettingDataComponent - 01_forward.py failure
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214856251 25200
# Node ID 5f49d1d08e8e7f9b905ef77d1a43e4b54917bd03
# Parent 7d3d5dcffad210d1da9f208ce1881f391a21ba9e
[TEST] Fix VirtualSystemSettingDataComponent - 01_forward.py failure.
Test was expecting one ProcRASD for each domain processor. It should expect onky one RASD.
Also updated this test to use PASS/FAIL, removed global variables, and cleaned up indention.
This test will need to be updated to support other XenFV, etc.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 7d3d5dcffad2 -r 5f49d1d08e8e suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Mon Jun 30 12:04:35 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Mon Jun 30 13:04:11 2008 -0700
@@ -58,6 +58,7 @@
from CimTest import Globals
from XenKvmLib import assoc
from CimTest.Globals import logger, do_main
+from CimTest.ReturnCodes import FAIL, PASS
sup_types = ['Xen']
@@ -67,35 +68,30 @@
test_disk = 'xvda'
status = 0
VSType = "Xen"
-vssd_names = []
-vssd_values = []
-RASD_cllist = [
- 'Xen_DiskResourceAllocationSettingData', \
- 'Xen_MemResourceAllocationSettingData', \
- 'Xen_NetResourceAllocationSettingData', \
- 'Xen_ProcResourceAllocationSettingData'
- ]
-
def init_list():
"""
Creating the lists that will be used for comparisons.
"""
- prop_list = []
- prop_list = ["%s/%s" % (test_dom, test_disk), \
- "%s/%s" % (test_dom, "mem"), \
- "%s/%s" % (test_dom, test_mac)
- ]
- proc_list = []
- for i in range(test_vcpus):
- proc_list.append("%s/%s" % (test_dom, i))
- return prop_list, proc_list
+
+ rlist = ['Xen_DiskResourceAllocationSettingData',
+ 'Xen_MemResourceAllocationSettingData',
+ 'Xen_NetResourceAllocationSettingData',
+ 'Xen_ProcResourceAllocationSettingData'
+ ]
+
+ prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk),
+ rlist[1] : "%s/%s" % (test_dom, "mem"),
+ rlist[2] : "%s/%s" % (test_dom, test_mac),
+ rlist[3] : "%s/%s" % (test_dom, "proc")
+ }
+
+ return prop_list
def build_vssd_info(ip, vssd):
"""
Creating the vssd fileds lists that will be used for comparisons.
"""
- global vssd_names, vssd_values
if vssd.Bootloader == "" or vssd.Caption == "" or \
vssd.InstanceID == "" or vssd.ElementName == "" or \
@@ -105,26 +101,17 @@
test_domain_function(test_dom, ip, "undefine")
sys.exit(status)
- vssd_names = [
- 'Bootloader', \
- 'Caption', \
- 'InstanceID', \
- 'ElementName', \
- 'VirtualSystemIdentifier', \
- 'VirtualSystemType', \
- ]
-
- vssd_values = [
- vssd.Bootloader, \
- vssd.Caption, \
- vssd.InstanceID, \
- vssd.ElementName, \
- vssd.VirtualSystemIdentifier, \
- vssd.VirtualSystemType, \
- ]
+ vssd_vals = {'Bootloader' : vssd.Bootloader,
+ 'Caption' : vssd.Caption,
+ 'InstanceID' : vssd.InstanceID,
+ 'ElementName' : vssd.ElementName,
+ 'VirtualSystemIdentifier' : vssd.VirtualSystemIdentifier,
+ 'VirtualSystemType' : vssd.VirtualSystemType
+ }
+ return vssd_vals
-def assoc_values(ip, assoc_info, cn):
+def assoc_values(ip, assoc_info, cn, an, vals):
"""
The association info of
Xen_VirtualSystemSettingDataComponent with every RASDclass is
@@ -132,36 +119,29 @@
Caption, InstanceID, ElementName, VirtualSystemIdentifier,
VirtualSystemType, Bootloader
"""
- global status
- global vssd_names, vssd_values
try:
if len(assoc_info) != 1:
- Globals.logger.error("Xen_VirtualSystemSettingDataComponent \
-returned %i Resource objects for class '%s'", len(assoc_info),cn)
- status = 1
- return status
+ Globals.logger.error("%s returned %i resource objects for '%s'" % \
+ (an, len(assoc_info), cn))
+ return FAIL
- for idx in range(len(vssd_names)):
- if assoc_info[0][vssd_names[idx]] != vssd_values[idx]:
- Globals.logger.error("%s Mismatch", vssd_names[idx])
- Globals.logger.error("Returned %s instead of %s", \
- assoc_info[0][vssd_names[idx]], \
- vssd_fields[idx])
- status = 1
- if status != 0:
- break
+ for prop, val in vals.iteritems():
+ if assoc_info[0][prop] != val:
+ Globals.logger.error("%s mismatch: returned %s instead of %s" %\
+ (prop, assoc_info[0][prop], val))
+ return FAIL
+
+ return PASS
+
except Exception, detail :
logger.error("Exception in assoc_values function: %s" % detail)
- status = 1
- test_domain_function(test_dom, ip, "undefine")
- return status
-
+ return FAIL
@do_main(sup_types)
def main():
options = main.options
- global status
+ status = FAIL
destroy_and_undefine_all(options.ip)
test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \
@@ -171,9 +151,7 @@
ret = test_domain_function(test_xml, options.ip, cmd = "define")
if not ret:
logger.error("Failed to define the dom: %s", test_dom)
- status = 1
- return status
-
+ return FAIL
instIdval = "%s:%s" % (VSType, test_dom)
keyname = "InstanceID"
@@ -183,48 +161,39 @@
vssd = enumclass.getInstance(options.ip, \
enumclass.Xen_VirtualSystemSettingData, \
key_list)
- build_vssd_info(options.ip, vssd)
+ if vssd is None:
+ logger.error("VSSD instance for %s not found" % test_dom)
+ test_domain_function(test_dom, options.ip, "undefine")
+ return FAIL
+
+ vssd_vals = build_vssd_info(options.ip, vssd)
except Exception, detail :
logger.error(Globals.CIM_ERROR_GETINSTANCE, \
- 'Xen_VirtualSystemSettingData')
+ 'Xen_VirtualSystemSettingData')
logger.error("Exception : %s" % detail)
test_domain_function(test_dom, options.ip, "undefine")
- status = 1
- return status
+ return FAIL
- prop_list, proc_list = init_list()
+ prop_list = init_list()
try:
- idx = 0
- # Looping through the RASD_cllist, call association
- # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist
- for rasd_cname in RASD_cllist:
- if rasd_cname != 'Xen_ProcResourceAllocationSettingData':
- assoc_info = assoc.Associators(options.ip, \
- 'Xen_VirtualSystemSettingDataComponent', \
- rasd_cname, \
- InstanceID = prop_list[idx])
- # Verify the association fields returned for particular rasd_cname.
- assoc_values(options.ip, assoc_info, rasd_cname)
- idx = idx + 1
- else:
- # Xen_ProcResourceAllocationSettingData, we need to find
- # association information for all the proc InstanceID and hence
- # we loop from 0 to (test_vcpus - 1 )
- for index in range(len(proc_list)):
- assoc_info = assoc.Associators(options.ip, \
- 'Xen_VirtualSystemSettingDataComponent', \
- rasd_cname, \
- InstanceID = prop_list[index])
+ # Looping through the RASD_cllist, call association
+ # Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist
+ an = 'Xen_VirtualSystemSettingDataComponent'
+ for rasd_cname, prop in prop_list.iteritems():
+ assoc_info = assoc.Associators(options.ip, an, rasd_cname,
+ InstanceID = prop)
# Verify the association fields returned for particular rasd_cname.
- assoc_values(options.ip, assoc_info, rasd_cname)
+ status = assoc_values(options.ip, assoc_info, rasd_cname, an,
+ vssd_vals)
+ if status != PASS:
+ break
except Exception, detail :
- logger.error(Globals.CIM_ERROR_ASSOCIATORS, \
- 'Xen_VirtualSystemSettingDataComponent')
+ logger.error(Globals.CIM_ERROR_ASSOCIATORS, an)
logger.error("Exception : %s" % detail)
- status = 1
+ status = FAIL
test_domain_function(test_dom, options.ip, "undefine")
return status
16 years, 5 months
[PATCH] [TEST] Some VirtualSystemManagementService -t 02_destroysystem.py cleanup
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214852675 25200
# Node ID 7d3d5dcffad210d1da9f208ce1881f391a21ba9e
# Parent 692121d37b3aefafce0d6856d81468add629514d
[TEST] Some VirtualSystemManagementService -t 02_destroysystem.py cleanup.
Add checks to see if the define() / start() calls pass.
Added cleanup_env() function to destroy()/undefine() guest in case of error.
Ensure status is set to PASS only if the guest is not found in the domain list after the DestroySystem() call is made.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 692121d37b3a -r 7d3d5dcffad2 suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Mon Jun 30 09:58:36 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Mon Jun 30 12:04:35 2008 -0700
@@ -35,47 +35,53 @@
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
default_dom = 'test_domain'
+def cleanup_env(ip, cxml):
+ cxml.destroy(ip)
+ cxml.undefine(ip)
+
@do_main(sup_types)
def main():
options = main.options
service = vsms.get_vsms_class(options.virt)(options.ip)
cxml = vxml.get_class(options.virt)(default_dom)
- cxml.define(options.ip)
- cxml.start(options.ip)
+ ret = cxml.define(options.ip)
+ if not ret:
+ logger.error("Failed to define the dom: %s", default_dom)
+ return FAIL
+ ret = cxml.start(options.ip)
+ if not ret:
+ logger.error("Failed to define the dom: %s", default_dom)
+ cleanup_env(options.ip, cxml)
+ return FAIL
classname = get_typed_class(options.virt, 'ComputerSystem')
cs_ref = CIMInstanceName(classname, keybindings = {
'Name':default_dom,
'CreationClassName':classname})
list_before = domain_list(options.ip, options.virt)
- status = PASS
- rc = -1
+ if default_dom not in list_before:
+ logger.error("Domain not in domain list")
+ cleanup_env(options.ip, cxml)
+ return FAIL
try:
service.DestroySystem(AffectedSystem=cs_ref)
- rc = 0
except Exception, details:
logger.error('Unknow exception happened')
logger.error(details)
- status = FAIL
+ cleanup_env(options.ip, cxml)
+ return FAIL
list_after = domain_list(options.ip, options.virt)
- status = PASS
- if default_dom not in list_before:
- logger.error("Domain not started, check config")
+ if default_dom in list_after:
+ logger.error("Domain %s not destroyed: provider didn't return error" % \
+ default_dom)
+ cleanup_env(options.ip, cxml)
status = FAIL
else:
- destroyed = set(list_before) - set(list_after)
- if len(destroyed) != 1:
- logger.error("Destroyed multiple domains")
- status = FAIL
- elif default_dom not in destroyed:
- logger.error("Wrong domain destroyed")
- status = FAIL
-
- cxml.undefine(options.ip)
+ status = PASS
return status
16 years, 5 months