CimTest Report for KVM on F9 30-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 : 83
LibVirtCIM : 651
CIMTEST : 262
=======================================================
PASS : 113
FAIL : 4
XFAIL : 1
SKIP : 12
-----------------
Total : 130
=======================================================
Here is one of the tc that failed
ComputerSystemIndication - 01_created_indication.py: FAIL
ERROR - Waited too long for indication
Need to investigate into this.
VirtualSystemManagementService - 08_modifyresource.py: FAIL
ERROR - Got 0, exp 262144.
ERROR - Error invoking ModifyRS: mod_mem_res
ERROR - Error changing rs for mem
VirtualSystemManagementService - 09_procrasd_persist.py: FAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed')
ERROR - Unable to start rstest_domain using RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
These above two test cases are failing since the tc is not able to
create a guest using the VSMS DefineSystem().
This can be fixed if by passing appropriate values to the
AllocationUnits of MemRASD.
Will be sending a fix for the same shortly.
VirtualSystemSettingDataComponent - 01_forward.py: FAIL
ERROR - Failed to define the dom: VSSDC_dom
Submitted fix for the above tc.
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: PASS
ComputerSystem - 03_defineVS.py: PASS
ComputerSystem - 04_defineStartVS.py: PASS
ComputerSystem - 05_activate_defined_start.py: PASS
ComputerSystem - 06_paused_active_suspend.py: PASS
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: 00001
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed')
ERROR - Exception: RequestedStateChange() could not be used to start domain: 'test_domain'
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
Bug:<00001>
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: FAIL
ERROR - Waited too long for indication
ElementAllocatedFromPool - 01_forward.py: PASS
ElementAllocatedFromPool - 02_reverse.py: PASS
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
ElementAllocatedFromPool - 04_forward_errs.py: PASS
ElementCapabilities - 01_forward.py: PASS
ElementCapabilities - 02_reverse.py: PASS
ElementCapabilities - 03_forward_errs.py: PASS
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
HostedService - 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: PASS
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: PASS
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: PASS
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
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
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
VirtualSystemManagementService - 06_addresource.py: PASS
VirtualSystemManagementService - 07_addresource_neg.py: PASS
VirtualSystemManagementService - 08_modifyresource.py: FAIL
ERROR - Got 0, exp 262144.
ERROR - Error invoking ModifyRS: mod_mem_res
ERROR - Error changing rs for mem
VirtualSystemManagementService - 09_procrasd_persist.py: FAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed')
ERROR - Unable to start rstest_domain using RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
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: FAIL
ERROR - Failed to define the dom: VSSDC_dom
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, 4 months
[PATCH] [TEST] Fix the create_diskpool_conf() function to creates a new netpool as the default
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1217473313 25200
# Node ID 66f3ea74ac3d93f77ca3ca81eee75d080f27d558
# Parent fc92abb3ae7cab32dec6718412be1c0d88874a4a
[TEST] Fix the create_diskpool_conf() function to creates a new netpool as the default
Also, update ResourceAllocationFromPool.01 & 02 to cleanup the netpool
when the test are done.
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r fc92abb3ae7c -r 66f3ea74ac3d suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 06:55:31 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 20:01:53 2008 -0700
@@ -33,7 +33,7 @@ from CimTest.Globals import logger, do_m
from CimTest.Globals import logger, do_main
from CimTest.ReturnCodes import PASS, FAIL, XFAIL
from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \
-create_netpool_conf
+create_netpool_conf, destroy_netpool
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
@@ -152,6 +152,7 @@ def main():
break
cleanup_restore(options.ip, options.virt)
+ destroy_netpool(options.ip, options.virt, test_network)
vsxml.undefine(options.ip)
return status
diff -r fc92abb3ae7c -r 66f3ea74ac3d suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 30 06:55:31 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 30 20:01:53 2008 -0700
@@ -34,7 +34,7 @@ from CimTest.ReturnCodes import PASS, FA
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib import enumclass
from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \
-create_netpool_conf
+create_netpool_conf, destroy_netpool
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
@@ -184,6 +184,7 @@ def main():
return status
cleanup_restore(server, virt)
+ destroy_netpool(server, virt, test_network)
vsxml.undefine(server)
return status
diff -r fc92abb3ae7c -r 66f3ea74ac3d suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Jul 30 06:55:31 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Jul 30 20:01:53 2008 -0700
@@ -360,7 +360,7 @@ def create_diskpool_conf(server, virt):
return status, diskid
-def create_netpool_conf(server, virt, use_existing=True):
+def create_netpool_conf(server, virt, use_existing=False):
status = PASS
test_network = None
try:
16 years, 4 months
[PATCH] [TEST] #3 Update HostSystem.04 for XenFV/KVM/LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1217471504 25200
# Node ID d095c79471e6b96828b560b6639f5945e86ba4f2
# Parent fc92abb3ae7cab32dec6718412be1c0d88874a4a
[TEST] #3 Update HostSystem.04 for XenFV/KVM/LXC support
Updates from 2 to 3:
Clean up the diskpool/netpool/guest before returning
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r fc92abb3ae7c -r d095c79471e6 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py
--- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 30 06:55:31 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 30 19:31:44 2008 -0700
@@ -52,17 +52,17 @@ from CimTest.Globals import logger, CIM_
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \
CIM_ERROR_ASSOCIATORS
from CimTest.Globals import do_main
+from XenKvmLib.vxml import XenXML, KVMXML, get_class
from XenKvmLib.assoc import AssociatorNames, Associators
from XenKvmLib.common_util import get_host_info
+from XenKvmLib.classes import get_typed_class
from CimTest.ReturnCodes import PASS, FAIL, SKIP
-from XenKvmLib.test_xml import testxml_bridge
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
-from VirtLib.live import network_by_bridge
+from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.logicaldevices import verify_device_values
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
-create_diskpool_file
+create_diskpool_file, create_netpool_conf, destroy_netpool
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "CrossClass_GuestDom"
test_mac = "00:11:22:33:44:aa"
@@ -72,30 +72,6 @@ diskid = "%s/%s" % ("DiskPool", test_dpa
diskid = "%s/%s" % ("DiskPool", test_dpath)
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
-
-def setup_env(server):
- destroy_and_undefine_all(server)
- test_xml, bridge = testxml_bridge(test_dom, mem = test_mem,
- vcpus = test_vcpus, mac = test_mac,
- disk = test_disk, server = server)
- if bridge == None:
- logger.error("Unable to find virtual bridge")
- return SKIP
-
- if test_xml == None:
- logger.error("Guest xml was not created properly")
- return FAIL
-
- virt_network = network_by_bridge(bridge, server)
- if virt_network == None:
- logger.error("No virtual network found for bridge %s", bridge)
- return SKIP
-
- ret = test_domain_function(test_xml, server, cmd = "create")
- if not ret:
- logger.error("Failed to create the dom: %s", test_dom)
- return FAIL
- return PASS
def print_err(err, detail, cn):
logger.error(err % cn)
@@ -112,35 +88,43 @@ def pool_init_list(pool_assoc):
in_pllist[classname_keyvalue] = instid
return in_pllist
-def eapf_list():
+def eapf_list(server, virt="Xen"):
+ disk_inst = get_typed_class(virt, "LogicalDisk")
+ proc_inst = get_typed_class(virt, "Processor")
+ net_inst = get_typed_class(virt, "NetworkPort")
+ mem_inst = get_typed_class(virt, "Memory")
+
disk = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_LogicalDisk",
- 'DeviceID' : "%s/%s" % (test_dom,test_disk),
+ 'CreationClassName' : disk_inst,
+ 'DeviceID' : "%s/%s" % (test_dom, test_disk),
'Name' : test_disk
}
proc = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_Processor",
+ 'CreationClassName' : proc_inst,
'DeviceID' : "%s/%s" % (test_dom,0)
}
net = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_NetworkPort",
+ 'CreationClassName' : net_inst,
'DeviceID' : "%s/%s" % (test_dom, test_mac),
'NetworkAddresses' : test_mac
}
mem = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_Memory",
+ 'CreationClassName' : mem_inst,
'DeviceID' : "%s/%s" % (test_dom, "mem"),
'NumberOfBlocks' : test_mem * 1024
}
- eaf_values = { "Xen_Processor" : proc,
- "Xen_LogicalDisk" : disk,
- "Xen_NetworkPort" : net,
- "Xen_Memory" : mem
- }
+ if virt == "LXC":
+ eaf_values = { mem_inst : mem}
+ else:
+ eaf_values = { proc_inst : proc,
+ disk_inst : disk,
+ net_inst : net,
+ mem_inst : mem
+ }
return eaf_values
def get_inst_for_dom(assoc_val):
@@ -152,13 +136,14 @@ def get_inst_for_dom(assoc_val):
return dom_list
-def get_assocname_info(server, cn, an, qcn, hostname):
+def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"):
status = PASS
assoc_info = []
try:
assoc_info = AssociatorNames(server,
an,
cn,
+ virt,
CreationClassName=cn,
Name = hostname)
if len(assoc_info) < 1:
@@ -172,7 +157,6 @@ def get_assocname_info(server, cn, an, q
if status != PASS:
cleanup_restore(server, virt='Xen')
- test_domain_function(test_dom, server, "destroy")
return status, assoc_info
@@ -183,24 +167,24 @@ def check_len(an, assoc_list_info, qcn,
return FAIL
return PASS
-def verify_eafp_values(server, in_pllist):
+def verify_eafp_values(server, in_pllist, virt="Xen"):
# Looping through the in_pllist to get association for various pools.
status = PASS
- an = "Xen_ElementAllocatedFromPool"
+ an = get_typed_class(virt, "ElementAllocatedFromPool")
exp_len = 1
qcn = "Logical Devices"
- eafp_values = eapf_list()
+ eafp_values = eapf_list(server, virt)
for cn, instid in sorted(in_pllist.items()):
try:
- assoc_info = Associators(server, an, cn, InstanceID = instid)
+ assoc_info = Associators(server, an, cn, virt, InstanceID = instid)
inst_list = get_inst_for_dom(assoc_info)
status = check_len(an, inst_list, qcn, exp_len)
if status != PASS:
break
assoc_eafp_info = inst_list[0]
CCName = assoc_eafp_info['CreationClassName']
- status = verify_device_values(assoc_eafp_info, CCName,
- eafp_values, virt='Xen')
+ status = verify_device_values(assoc_eafp_info,
+ eafp_values, virt)
if status != PASS:
return status
@@ -216,41 +200,69 @@ def main():
def main():
options= main.options
server = options.ip
- virt=options.virt
+ if options.virt == "XenFV":
+ virt = "Xen"
+ else:
+ virt=options.virt
# Get the host info
- status, host_name, classname = get_host_info(server)
+ status, host_name, classname = get_host_info(server, virt)
if status != PASS:
return status
+ destroy_and_undefine_all(server)
+ virt_type = get_class(virt)
+ if virt == 'LXC':
+ vsxml = virt_type(test_dom)
+ else:
+ vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac,
+ disk = test_disk)
+ ret = vsxml.define(server)
+ if not ret:
+ logger.error("Failed to define the dom: '%s'", test_dom)
+ return FAIL
# Verify DiskPool on machine
status = create_diskpool_file()
if status != PASS:
- return status
+ logger.error("Failed to create diskpool")
+ vsxml.undefine(server)
+ return FAIL
+ # Create NetPool on machine
+ status, net_name = create_netpool_conf(server, virt, use_existing=False)
+ if status != PASS:
+ logger.error('Unable to create network pool')
+ vsxml.undefine(server)
+ cleanup_restore(server, virt=virt)
+ return FAIL
# Get the hostedResourcePool info first
cn = classname
- an = "Xen_HostedResourcePool"
+ an = get_typed_class(virt, "HostedResourcePool")
qcn = "Device Pool"
- status, pool = get_assocname_info(server, cn, an, qcn, host_name)
+ status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt)
if status != PASS:
+ vsxml.undefine(server)
+ cleanup_restore(server, virt=virt)
+ destroy_netpool(server, virt, net_name)
return status
-
- # One pool for each Device type, hence len should be 4
+ # One pool for each Device type, hence len should be 4
exp_len = 4
- status = status = check_len(an, pool, qcn, exp_len)
+ status = check_len(an, pool, qcn, exp_len)
if status != PASS:
+ vsxml.undefine(server)
+ cleanup_restore(server, virt=virt)
+ destroy_netpool(server, virt, net_name)
return FAIL
- status = setup_env(server)
- if status != PASS:
- cleanup_restore(server, virt=virt)
- test_domain_function(test_dom, server, cmd = "destroy")
- return status
-
in_pllist = pool_init_list(pool)
- status = verify_eafp_values(server, in_pllist)
- ret = test_domain_function(test_dom, server, cmd = "destroy")
+ if virt == 'LXC':
+ for cn, instid in in_pllist.items():
+ if cn == 'LXC_MemoryPool':
+ in_pllist = {cn: instid}
+ break
+ status = verify_eafp_values(server, in_pllist, virt)
+ vsxml.undefine(server)
cleanup_restore(server, virt=virt)
+ destroy_netpool(server, virt, net_name)
return status
if __name__ == "__main__":
sys.exit(main())
16 years, 4 months
[PATCH] [TEST] Call destroy_netpool() to remove the created netpool in tc
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1217401967 25200
# Node ID 484734992819e58369974ac579a6c39c1bcd0cfa
# Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb
[TEST] Call destroy_netpool() to remove the created netpool in tc
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jul 30 00:12:47 2008 -0700
@@ -33,7 +33,7 @@
from CimTest.Globals import logger, do_main
from CimTest.ReturnCodes import PASS, FAIL, XFAIL
from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \
-create_netpool_conf
+create_netpool_conf, destroy_netpool
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
@@ -152,6 +152,7 @@
break
cleanup_restore(options.ip, options.virt)
+ destroy_netpool(options.ip, options.virt, test_network)
vsxml.undefine(options.ip)
return status
diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Wed Jul 30 00:12:47 2008 -0700
@@ -34,7 +34,7 @@
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib import enumclass
from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \
-create_netpool_conf
+create_netpool_conf, destroy_netpool
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
@@ -184,6 +184,7 @@
return status
cleanup_restore(server, virt)
+ destroy_netpool(server, virt, test_network)
vsxml.undefine(server)
return status
diff -r 2efc46fd30f3 -r 484734992819 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Jul 30 00:12:47 2008 -0700
@@ -63,7 +63,7 @@
CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \
-create_netpool_conf
+create_netpool_conf, destroy_netpool
from XenKvmLib.common_util import print_field_error
platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -148,9 +148,9 @@
except Exception, detail:
logger.error("Exception: %s", detail)
- return FAIL, dpool, npool, mpool, ppool
+ return FAIL, dpool, npool, mpool, ppool, test_network
- return PASS, dpool, npool, mpool, ppool
+ return PASS, dpool, npool, mpool, ppool, test_network
def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist):
for inst in assoc_info:
@@ -200,7 +200,7 @@
server = options.ip
virt = options.virt
- status, dpool, npool, mpool, ppool = get_pool_details(virt, server)
+ status, dpool, npool, mpool, ppool, test_network = get_pool_details(virt, server)
if status != PASS or dpool.InstanceID == None or mpool.InstanceID == None \
or npool.InstanceID == None or ppool.InstanceID == None:
cleanup_restore(server, virt)
@@ -208,6 +208,7 @@
status = verify_sdc_with_ac(virt, server, dpool, npool, mpool, ppool)
cleanup_restore(server, virt)
+ destroy_netpool(server, virt, test_network)
return status
if __name__ == "__main__":
16 years, 4 months
[PATCH] Fix type typo in VSMigrationService:raise_deleted_ind()
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1217447729 25200
# Node ID 8b18b2a122d73a517c98b971841ebe3642d33578
# Parent d7406e2f4670208cfe61ef9c0065164292ab3942
Fix type typo in VSMigrationService:raise_deleted_ind()
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r d7406e2f4670 -r 8b18b2a122d7 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Tue Jul 29 12:34:38 2008 -0700
+++ b/src/Virt_VSMigrationService.c Wed Jul 30 12:55:29 2008 -0700
@@ -857,7 +857,7 @@
ind = prepare_indication(_BROKER, inst, job->ref_ns, MIG_DELETED, &s);
- rc = raise_indication(job->context, MIG_MODIFIED, job->ref_ns,
+ rc = raise_indication(job->context, MIG_DELETED, job->ref_ns,
inst, ind);
if (!rc)
CU_DEBUG("Failed to raise indication");
16 years, 4 months
[PATCH] [TEST] #3 Check that the DefineSystem() result can be passed to GetInstance()
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1217427140 25200
# Node ID be869ee37ebd8cd304751dd67b7ac47ce6c642ce
# Parent 753ddf4191cff036c917376039299a4e525db1c9
[TEST] #3 Check that the DefineSystem() result can be passed to GetInstance()
Changes:
- Check that ResultingSystem is a REF instead of an instance too
- Handle case where results does not include a ResultingSystem
- Undefine test domain before exit
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 753ddf4191cf -r be869ee37ebd suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_define_result.py Wed Jul 30 07:12:20 2008 -0700
@@ -0,0 +1,106 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Dan Smith <danms(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+sup_types = ['Xen', 'XenFV', 'KVM']
+default_dom = "define_test"
+
+import sys
+import pywbem
+from CimTest.ReturnCodes import FAIL, PASS
+from CimTest.Globals import do_main
+from CimTest.Globals import logger
+from CimTest import Globals
+from XenKvmLib import vsms
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.test_doms import undefine_test_domain
+
+def define_system(host, virt, name, vssd, rasds):
+ vsms_class = eval("vsms." + \
+ get_typed_class(virt,
+ "VirtualSystemManagementService"))
+
+ service = vsms_class(host)
+
+ rc, results = service.DefineSystem(SystemSettings=vssd,
+ ResourceSettings=rasds,
+ ReferenceConfiguration=' ')
+
+ try:
+ system = results["ResultingSystem"]
+ except KeyError:
+ logger.error("DefineSystem() did not return a ResultingSystem")
+ return FAIL, None
+
+ return rc, system
+
+def get_instance_by_ref(host, ref):
+ conn = pywbem.WBEMConnection('http://%s' % host,
+ (Globals.CIM_USER, Globals.CIM_PASS),
+ ref.namespace)
+ return conn.GetInstance(ref)
+
+def define_test_system(options):
+ vssd_class = vsms.get_vssd_class(options.virt)
+ vssd = vssd_class(name=default_dom, virt=options.virt)
+
+ mrasd_class = vsms.get_masd_class(options.virt)
+ mrasd = mrasd_class(32, default_dom)
+
+ rc, system = define_system(options.ip,
+ options.virt,
+ default_dom,
+ vssd.mof(),
+ [mrasd.mof()])
+
+ return rc, system
+
+@do_main(sup_types)
+def main():
+ options = main.options
+
+ rc, systemref = define_test_system(options)
+ if systemref is None:
+ return rc
+
+ if not isinstance(systemref, pywbem.CIMInstanceName):
+ logger.error("ResultingSystem is not a Reference!")
+ return FAIL
+
+ if systemref.namespace is None:
+ logger.error("Returned reference had no namespace!")
+ return FAIL
+
+ logger.info("GetInstance(%s)" % systemref)
+ system = get_instance_by_ref(options.ip, systemref)
+
+ undefine_test_domain(default_dom, options.ip, virt=options.virt)
+
+ if system["Name"] == default_dom:
+ logger.info("Validated resulting system instance")
+ return PASS
+ else:
+ logger.error("Result system was: %s instead of %s" % (system["Name"],
+ default_dom))
+ return FAIL
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 4 months
[PATCH] [TEST]#2 Update HostSystem.04 for XenFV/KVM/LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1217403718 25200
# Node ID b0af611e1fde61297aa300a0d5f51ebc0a5de1c3
# Parent 2efc46fd30f33e06c20ca8c771abed65725a3fdb
[TEST]#2 Update HostSystem.04 for XenFV/KVM/LXC support
Updates from 1 to 2:
define a network pool for test
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 2efc46fd30f3 -r b0af611e1fde suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py
--- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 23 17:42:47 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Jul 30 00:41:58 2008 -0700
@@ -52,17 +52,17 @@
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \
CIM_ERROR_ASSOCIATORS
from CimTest.Globals import do_main
+from XenKvmLib.vxml import XenXML, KVMXML, get_class
from XenKvmLib.assoc import AssociatorNames, Associators
from XenKvmLib.common_util import get_host_info
+from XenKvmLib.classes import get_typed_class
from CimTest.ReturnCodes import PASS, FAIL, SKIP
-from XenKvmLib.test_xml import testxml_bridge
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
-from VirtLib.live import network_by_bridge
+from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.logicaldevices import verify_device_values
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
-create_diskpool_file
+create_diskpool_file, create_netpool_conf, destroy_netpool
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "CrossClass_GuestDom"
test_mac = "00:11:22:33:44:aa"
@@ -72,30 +72,6 @@
diskid = "%s/%s" % ("DiskPool", test_dpath)
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
-
-def setup_env(server):
- destroy_and_undefine_all(server)
- test_xml, bridge = testxml_bridge(test_dom, mem = test_mem,
- vcpus = test_vcpus, mac = test_mac,
- disk = test_disk, server = server)
- if bridge == None:
- logger.error("Unable to find virtual bridge")
- return SKIP
-
- if test_xml == None:
- logger.error("Guest xml was not created properly")
- return FAIL
-
- virt_network = network_by_bridge(bridge, server)
- if virt_network == None:
- logger.error("No virtual network found for bridge %s", bridge)
- return SKIP
-
- ret = test_domain_function(test_xml, server, cmd = "create")
- if not ret:
- logger.error("Failed to create the dom: %s", test_dom)
- return FAIL
- return PASS
def print_err(err, detail, cn):
logger.error(err % cn)
@@ -112,35 +88,43 @@
in_pllist[classname_keyvalue] = instid
return in_pllist
-def eapf_list():
+def eapf_list(server, virt="Xen"):
+ disk_inst = get_typed_class(virt, "LogicalDisk")
+ proc_inst = get_typed_class(virt, "Processor")
+ net_inst = get_typed_class(virt, "NetworkPort")
+ mem_inst = get_typed_class(virt, "Memory")
+
disk = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_LogicalDisk",
- 'DeviceID' : "%s/%s" % (test_dom,test_disk),
+ 'CreationClassName' : disk_inst,
+ 'DeviceID' : "%s/%s" % (test_dom, test_disk),
'Name' : test_disk
}
proc = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_Processor",
+ 'CreationClassName' : proc_inst,
'DeviceID' : "%s/%s" % (test_dom,0)
}
net = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_NetworkPort",
+ 'CreationClassName' : net_inst,
'DeviceID' : "%s/%s" % (test_dom, test_mac),
'NetworkAddresses' : test_mac
}
mem = {
'SystemName' : test_dom,
- 'CreationClassName' : "Xen_Memory",
+ 'CreationClassName' : mem_inst,
'DeviceID' : "%s/%s" % (test_dom, "mem"),
'NumberOfBlocks' : test_mem * 1024
}
- eaf_values = { "Xen_Processor" : proc,
- "Xen_LogicalDisk" : disk,
- "Xen_NetworkPort" : net,
- "Xen_Memory" : mem
- }
+ if virt == "LXC":
+ eaf_values = { mem_inst : mem}
+ else:
+ eaf_values = { proc_inst : proc,
+ disk_inst : disk,
+ net_inst : net,
+ mem_inst : mem
+ }
return eaf_values
def get_inst_for_dom(assoc_val):
@@ -152,13 +136,14 @@
return dom_list
-def get_assocname_info(server, cn, an, qcn, hostname):
+def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"):
status = PASS
assoc_info = []
try:
assoc_info = AssociatorNames(server,
an,
cn,
+ virt,
CreationClassName=cn,
Name = hostname)
if len(assoc_info) < 1:
@@ -172,7 +157,6 @@
if status != PASS:
cleanup_restore(server, virt='Xen')
- test_domain_function(test_dom, server, "destroy")
return status, assoc_info
@@ -183,24 +167,24 @@
return FAIL
return PASS
-def verify_eafp_values(server, in_pllist):
+def verify_eafp_values(server, in_pllist, virt="Xen"):
# Looping through the in_pllist to get association for various pools.
status = PASS
- an = "Xen_ElementAllocatedFromPool"
+ an = get_typed_class(virt, "ElementAllocatedFromPool")
exp_len = 1
qcn = "Logical Devices"
- eafp_values = eapf_list()
+ eafp_values = eapf_list(server, virt)
for cn, instid in sorted(in_pllist.items()):
try:
- assoc_info = Associators(server, an, cn, InstanceID = instid)
+ assoc_info = Associators(server, an, cn, virt, InstanceID = instid)
inst_list = get_inst_for_dom(assoc_info)
status = check_len(an, inst_list, qcn, exp_len)
if status != PASS:
break
assoc_eafp_info = inst_list[0]
CCName = assoc_eafp_info['CreationClassName']
- status = verify_device_values(assoc_eafp_info, CCName,
- eafp_values, virt='Xen')
+ status = verify_device_values(assoc_eafp_info,
+ eafp_values, virt)
if status != PASS:
return status
@@ -216,41 +200,60 @@
def main():
options= main.options
server = options.ip
- virt=options.virt
+ if options.virt == "XenFV":
+ virt = "Xen"
+ else:
+ virt=options.virt
# Get the host info
- status, host_name, classname = get_host_info(server)
+ status, host_name, classname = get_host_info(server, virt)
if status != PASS:
return status
+ destroy_and_undefine_all(server)
+ virt_type = get_class(virt)
+ if virt == 'LXC':
+ vsxml = virt_type(test_dom)
+ else:
+ vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac,
+ disk = test_disk)
+ ret = vsxml.define(server)
+ if not ret:
+ logger.error("Failed to define the dom: '%s'", test_dom)
+ return FAIL
+ cleanup_restore(server, virt=virt)
# Verify DiskPool on machine
status = create_diskpool_file()
if status != PASS:
return status
+ # Create NetPool on machine
+ status, net_name = create_netpool_conf(server, virt)
+ if status != PASS:
+ logger.error('Unable to create network pool')
+ return FAIL
# Get the hostedResourcePool info first
cn = classname
- an = "Xen_HostedResourcePool"
+ an = get_typed_class(virt, "HostedResourcePool")
qcn = "Device Pool"
- status, pool = get_assocname_info(server, cn, an, qcn, host_name)
+ status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt)
if status != PASS:
return status
-
- # One pool for each Device type, hence len should be 4
+ # One pool for each Device type, hence len should be 4
exp_len = 4
status = status = check_len(an, pool, qcn, exp_len)
if status != PASS:
return FAIL
- status = setup_env(server)
- if status != PASS:
- cleanup_restore(server, virt=virt)
- test_domain_function(test_dom, server, cmd = "destroy")
- return status
-
in_pllist = pool_init_list(pool)
- status = verify_eafp_values(server, in_pllist)
- ret = test_domain_function(test_dom, server, cmd = "destroy")
+ if virt == 'LXC':
+ for cn, instid in in_pllist.items():
+ if cn == 'LXC_MemoryPool':
+ in_pllist = {cn: instid}
+ break
+ status = verify_eafp_values(server, in_pllist, virt)
+ vsxml.undefine(server)
cleanup_restore(server, virt=virt)
+ destroy_netpool(server, virt, net_name)
return status
if __name__ == "__main__":
sys.exit(main())
16 years, 4 months
[PATCH] [TEST] #2 Verify functionality of MemoryRASD units specification for VSMS
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1217426536 25200
# Node ID dcffd5acd5e13b447a9eb0fd1fb3ee79586ad975
# Parent e3d4987d295d2905b921a1a3980430cd7bb03735
[TEST] #2 Verify functionality of MemoryRASD units specification for VSMS
Changes:
- Removed dead code
- Removed unneeded try..except block
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r e3d4987d295d -r dcffd5acd5e1 suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Wed Jul 30 07:02:16 2008 -0700
@@ -0,0 +1,130 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Dan Smith <danms(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+import sys
+import pywbem
+from VirtLib import live
+from XenKvmLib import vsms
+from XenKvmLib.test_doms import undefine_test_domain
+from XenKvmLib.common_util import create_using_definesystem
+from XenKvmLib import rasd
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib import enumclass
+from CimTest.Globals import do_main
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS
+
+sup_types = ['Xen', 'XenFV', 'KVM']
+default_dom = "memrasd_test"
+
+mem_bytes = 2 << 30
+
+values = [
+ ("Bytes", 0),
+ ("KiloBytes", 10),
+ ("MegaBytes", 20),
+ ("GigaBytes", 30),
+ ]
+
+def try_define(options, vssd, units, value):
+ mrasd_class = vsms.get_masd_class(options.virt)
+ mrasd = mrasd_class(None, default_dom)
+
+ mrasd.AllocationUnits = units
+ mrasd.VirtualQuantity = value
+
+ params = {
+ "vssd" : vssd.mof(),
+ "rasd" : [mrasd.mof()],
+ }
+
+ logger.info("Defining with %s = %i" % (units, value))
+ rc = create_using_definesystem(default_dom,
+ options.ip,
+ params=params,
+ virt=options.virt)
+
+ if rc != PASS:
+ logger.error("DefineSystem (%s) failed" % units)
+ return False
+
+ return True
+
+def check_value(options):
+ mrasd_cn = get_typed_class(options.virt, rasd.masd_cn)
+ rasds = enumclass.enumerate_inst(options.ip, mrasd_cn, options.virt)
+
+ the_rasd = None
+ mem_kb = mem_bytes >> 10
+
+ for _rasd in rasds:
+ if _rasd["InstanceID"] == "%s/mem" % default_dom:
+ the_rasd = _rasd
+
+ if not the_rasd:
+ logger.error("Did not find test RASD on server")
+ return False
+
+ if the_rasd["AllocationUnits"] != "KiloBytes":
+ logger.error("MRASD units are not kilobytes?")
+ return False
+
+ cim_kb = int(the_rasd["VirtualQuantity"])
+
+ if cim_kb != mem_kb:
+ logger.error("CIM reports %i KB instead of %i KB" % (cim_kb, mem_kb))
+ return False
+
+ logger.info("Verified %i KB" % mem_kb)
+
+ return True
+
+
+@do_main(sup_types)
+def main():
+ options = main.options
+
+ vssd_class = vsms.get_vssd_class(options.virt)
+ vssd = vssd_class(name=default_dom, virt=options.virt)
+
+ status = PASS
+
+ for units, shift in values:
+ value = mem_bytes >> shift
+
+ if not try_define(options, vssd, units, value):
+ status = FAIL
+ break
+
+ if not check_value(options):
+ status = FAIL
+ break
+
+ undefine_test_domain(default_dom, options.ip, virt=options.virt)
+
+ undefine_test_domain(default_dom, options.ip, virt=options.virt)
+
+
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 4 months
[PATCH] [TEST] #2 Add test for hypervisor version string
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1217426131 25200
# Node ID e3d4987d295d2905b921a1a3980430cd7bb03735
# Parent 32d78f23f6e73f5443022179410128767896465d
[TEST] #2 Add test for hypervisor version string
Changes:
- Check for None result of service
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 32d78f23f6e7 -r e3d4987d295d lib/VirtLib/live.py
--- a/lib/VirtLib/live.py Wed Jul 23 00:32:36 2008 -0700
+++ b/lib/VirtLib/live.py Wed Jul 30 06:55:31 2008 -0700
@@ -347,3 +347,10 @@
return out
return None
+def get_hv_ver(server, virt="Xen"):
+ cmd = "virsh -c %s version | grep ^Running | cut -d ' ' -f 3,4" % utils.virt2uri(virt)
+ ret, out = utils.run_remote(server, cmd)
+ if ret == 0:
+ return out
+ else:
+ return None
diff -r 32d78f23f6e7 -r e3d4987d295d suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py Wed Jul 30 06:55:31 2008 -0700
@@ -0,0 +1,63 @@
+#!/usr/bin/python
+#
+# Copyright 2008 IBM Corp.
+#
+# Authors:
+# Dan Smith <danms(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+import sys
+import pywbem
+from VirtLib import live
+from XenKvmLib import vsms
+from CimTest.Globals import do_main
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS
+
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+
+@do_main(sup_types)
+def main():
+ options = main.options
+
+ try:
+ service = vsms.enumerate_instances(options.ip, options.virt)[0]
+ except Exception, details:
+ service = None
+
+ if not service:
+ logger.error("Did not find VSMS instance")
+ logger.error(details)
+ return FAIL
+
+ try:
+ cim_ver = service["Caption"]
+ local_ver = live.get_hv_ver(options.ip, options.virt)
+
+ if cim_ver != local_ver:
+ logger.error("CIM says version is `%s', but libvirt says `%s'")
+ return FAIL
+ else:
+ logger.info("Verified %s == %s" % (cim_ver, local_ver))
+ except Exception, details:
+ logger.error(details)
+ return FAIL
+
+ return PASS
+
+if __name__ == "__main__":
+ sys.exit(main())
16 years, 4 months
[PATCH] [TEST] #2 Add stack trace on error to make test case development easier
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1217262465 25200
# Node ID 9e1d09bf6636d3a0244ee3224b22dcba267425d5
# Parent a39dc855b73eb6f5a960bc377a093d3fa953f926
[TEST] #2 Add stack trace on error to make test case development easier
Changes:
- Fix whitespace issue
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r a39dc855b73e -r 9e1d09bf6636 lib/CimTest/Globals.py
--- a/lib/CimTest/Globals.py Mon Jul 28 09:20:54 2008 -0700
+++ b/lib/CimTest/Globals.py Mon Jul 28 09:27:45 2008 -0700
@@ -25,6 +25,7 @@
import os
import logging
from optparse import OptionParser
+import traceback
global CIM_USER
global CIM_PASS
@@ -143,6 +144,7 @@
rc = f()
except Exception, e:
logger.error('%s : %s' % (e.__class__.__name__, e))
+ logger.error("%s" % traceback.print_exc())
rc = FAIL
return rc
setattr(do_try, 'options', options)
16 years, 4 months