simple question!
by 072021096
Hello every
i am new here, so I want to ask a simple. It must be simple for you, but it bothered me so much. When I ./configure the libvirt-cim, it said cannot find the CMPI header, how should I do. PS: I use sfcb. but when i insall sfcb i cannot find the CMPI headers installed! what is wrong?
Thank you!!!
16 years, 5 months
[PATCH] [TEST] Fix CS 22 to use providers instead of virsh
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1215725330 25200
# Node ID 86285f56abcaf54595bc2cc54c8f044ae37ccbd7
# Parent 0a4bc49a1fbde309070f8cc4c8631cf4a5ad9c68
[TEST] Fix CS 22 to use providers instead of virsh.
This test was defining a guest with virsh and then suspending it with virsh, which doesn't touch the providers in anyway. Now the test calls DefineSystem() and RequestStateChange().
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 0a4bc49a1fbd -r 86285f56abca suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Jul 10 12:39:32 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Jul 10 14:28:50 2008 -0700
@@ -32,54 +32,47 @@
from XenKvmLib import computersystem
from VirtLib import utils
from XenKvmLib import vxml
-from XenKvmLib.test_doms import destroy_and_undefine_all
-from CimTest.Globals import do_main
-from CimTest import Globals
+from XenKvmLib.test_doms import destroy_and_undefine_domain
+from CimTest.Globals import do_main, logger
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.common_util import create_using_definesystem, \
+ call_request_state_change
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "domgst"
+SUSPND_STATE = 9
+TIME = "00000000000000.000000:000"
+
@do_main(sup_types)
def main():
options = main.options
- status = FAIL
- cxml = vxml.get_class(options.virt)(test_dom)
-
-#define VS
try:
- ret = cxml.define(options.ip)
- if not ret:
- Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom)
- return status
-
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
- if not (cs.Name == test_dom) :
- Globals.logger.error("Error: VS %s not found" % test_dom)
- cxml.undefine(options.ip)
+ # define the vs
+ status = create_using_definesystem(test_dom, options.ip,
+ virt=options.virt)
+ if status != PASS:
+ logger.error("Unable to define %s using DefineSystem()" % test_dom)
return status
- except Exception, detail:
- Globals.logger.error("Errors: %s" % detail)
-
-#Suspend the defined VS
-
- try:
- ret = cxml.run_virsh_cmd(options.ip, "suspend")
- if not ret :
- Globals.logger.info("Suspending defined VS %s failed, as expected" \
-% test_dom)
+ # suspend the vs
+ status = call_request_state_change(test_dom, options.ip, SUSPND_STATE,
+ TIME, virt=options.virt)
+ if status != PASS:
+ logger.info("Suspending define VS %s failed, as expected" \
+ % test_dom)
status = PASS
else :
- Globals.logger.info("Error: Suspending defined VS %s should not \
-have been allowed" % test_dom)
+ logger.error("Suspending defined VS %s should not have passed" % \
+ test_dom)
status = FAIL
except Exception, detail:
- Globals.logger.error("Error: %s" % detail)
+ logger.error("Error: %s" % detail)
+ status = FAIL
- ret = cxml.undefine(options.ip)
+ destroy_and_undefine_domain(test_dom, options.ip, options.virt)
return status
if __name__ == "__main__":
16 years, 5 months
CimTest Report on XenFV 17-07-2008
by Deepti B Kalakeri
======================================
CIM Test Report for XenFV
======================================
Distro : RHEL 5.2 Beta
Kernel : 2.6.18-88.el5xen
Xen version : 3.1.2-88.el5
Libvirt : libvirt-0.3.3-7.el5
CIMOM : pegasus
PyWBEM : pywbem-3.14
CIM Schema : cimv216Experimental
LibCMPIutil : 79
LibVirtCIM : 637
CIMTEST : 249
======================================
PASS : 92
TOTAL FAILED : 14 [13 test cases passed when ran manually]
ACTUAL FAILED : 1
XFAIL : 6
SKIP : 18
-------------------
Total : 130
======================================
List of tc that are failing:
ComputerSystem - 06_paused_active_suspend.py: FAIL
The following tc passed when run manually:
ComputerSystem - 03_defineVS.py
ComputerSystem - 42_cs_gi_errs.py
ElementConforms - 01_forward.py
ElementConforms - 02_reverse.py
ElementSettingData - 01_forward.py
EnabledLogicalElementCapabilities - 01_enum.py
LogicalDisk - 02_nodevs.py
LogicalDisk - 03_ld_gi_errs.py
Memory - 01_memory.py
NetworkPort - 01_netport.py
VSSD - 04_vssd_to_rasd.py
VirtualSystemManagementService - 08_modifyresource.py
VirtualSystemManagementService - 09_procrasd_persist.py
Please find the complete report attached with the mail.
Thanks and Regards,
Deepti.
ComputerSystem - 03_defineVS.py: FAIL
ComputerSystem - 06_paused_active_suspend.py: FAIL
ComputerSystem - 42_cs_gi_errs.py: FAIL
ElementConforms - 01_forward.py: FAIL
ElementConforms - 02_reverse.py: FAIL
ElementSettingData - 01_forward.py: FAIL
EnabledLogicalElementCapabilities - 01_enum.py: FAIL
LogicalDisk - 02_nodevs.py: FAIL
LogicalDisk - 03_ld_gi_errs.py: FAIL
Memory - 01_memory.py: FAIL
NetworkPort - 01_netport.py: FAIL
VSSD - 04_vssd_to_rasd.py: FAIL
VirtualSystemManagementService - 08_modifyresource.py: FAIL
VirtualSystemManagementService - 09_procrasd_persist.py: FAIL
Starting test suite: libvirt-cim
Cleaned log files.
Testing XenFV 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: FAIL
ERROR - Failed to enumerate the class of Xen_ComputerSystem
ERROR - Exception: No defined domain (domU1) is found
ERROR - Error: property values are not set for VS domU1
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: FAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain not running')
ERROR - Unable to suspend dom DomST1 using RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain not running
ComputerSystem - 22_define_suspend.py: PASS
ComputerSystem - 23_suspend_suspend.py: XFAIL Bug: 00002
ERROR - RequestedState should be 2 not 12
ERROR - Attributes for dom test_domain not set as expected.
Bug:<00002>
ComputerSystem - 27_define_suspend_errs.py: PASS
ComputerSystem - 32_start_reboot.py: XFAIL Bug: 00002
ERROR - RequestedState should be 2 not 12
ERROR - Attributes for dom test_domain not set as expected.
Bug:<00002>
ComputerSystem - 33_suspend_reboot.py: XFAIL Bug: 00002
ERROR - RequestedState should be 2 not 12
ERROR - Attributes for dom test_domain not set as expected.
Bug:<00002>
ComputerSystem - 35_start_reset.py: XFAIL Bug: 00002
ERROR - RequestedState should be 2 not 12
ERROR - Attributes for dom test_domain not set as expected.
Bug:<00002>
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: FAIL
ERROR - Unexpected rc code 6 and description CIM_ERR_NOT_FOUND: No such instance (ETdomain).
ERROR - ------ FAILED: Invalid CCName Key Value.------
ERROR - Unexpected rc code 6 and description CIM_ERR_NOT_FOUND: No such instance (ETdomain).
ERROR - ------ FAILED: Invalid CCName Key Name.------
ComputerSystemIndication - 01_created_indication.py: PASS
ElementAllocatedFromPool - 01_forward.py: PASS
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
ElementCapabilities - 03_forward_errs.py: PASS
ElementCapabilities - 04_reverse_errs.py: PASS
ElementCapabilities - 05_hostsystem_cap.py: PASS
ElementConforms - 01_forward.py: FAIL
ERROR - Failed to get associators information for ElementConformsToProfile
ERROR - Exception: not enough arguments for format string
ElementConforms - 02_reverse.py: FAIL
ERROR - ERROR: Instance for domgst not created
ElementConforms - 03_ectp_fwd_errs.py: PASS
ElementConforms - 04_ectp_rev_errs.py: PASS
ElementSettingData - 01_forward.py: FAIL
ERROR - Expected at least one VirtualSystemSettingData instance
CIM_ERR_NOT_FOUND: No such instance (esd_dom)
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: SKIP
EnabledLogicalElementCapabilities - 01_enum.py: FAIL
ERROR - Get domain list error, the number of domains is not equal
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: SKIP
HostedDependency - 02_reverse.py: SKIP
HostedDependency - 03_enabledstate.py: SKIP
HostedDependency - 04_reverse_errs.py: SKIP
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: FAIL
ERROR - LogicalDisk returned 1 instead of empty list
LogicalDisk - 03_ld_gi_errs.py: FAIL
ERROR - Failed to get instance by the class of Xen_LogicalDisk
ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (hd_domain/hda)')
Memory - 01_memory.py: FAIL
ERROR - Capacity should be 262144 MB instead of 131072 MB
Memory - 02_defgetmem.py: PASS
Memory - 03_mem_gi_errs.py: PASS
NetworkPort - 01_netport.py: FAIL
ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (test_domain/00:11:22:33:44:55)')
NetworkPort - 02_np_gi_errors.py: PASS
NetworkPort - 03_user_netport.py: SKIP
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: SKIP
ResourcePool - 02_rp_gi_errors.py: SKIP
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: FAIL
ERROR - Xen_VirtualSystemSettingData with VSSDC_dom was not returned
ERROR - Xen_VirtualSystemSettingData returned 0 VSSD objects, expected only 1
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: SKIP
VirtualSystemManagementService - 07_addresource_neg.py: PASS
VirtualSystemManagementService - 08_modifyresource.py: FAIL
ERROR - Got None, exp /tmp/default-kvm-dimage.2ND.
ERROR - Error invoking ModifyRS: mod_disk_res
ERROR - Error changing rs for disk path
VirtualSystemManagementService - 09_procrasd_persist.py: FAIL
ERROR - limit is 0, expected 256
ERROR - rstest_domain CPU scheduling not set properly
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
test list in SKIPPING status for KVM
by Guo Lian Yun
Floks,
Here are the tests that are currently in SKIPPING status for KVM.
Y - Needs to be implemented
N - Does not to be implemented
If there is any misktake please let me know.
Test
KVM
ComputerSystem - 23_suspend_suspend.py: SKIP
Y
ComputerSystem - 27_define_suspend_errs.py
Y
ComputerSystem - 32_start_reboot.py
Y
ComputerSystem - 33_suspend_reboot.py
Y
ComputerSystem - 35_start_reset.py
Y
ComputerSystem - 41_cs_to_settingdefinestate.py
Y
ElementAllocatedFromPool - 01_forward.py
Y
ElementAllocatedFromPool - 02_reverse.py
Y
HostSystem - 04_hs_to_EAPF.py
Y
VSSD - 02_bootldr.py
N
VirtualSystemMigrationService - 01_migratable_host.py
Y
VirtualSystemMigrationService - 02_host_migrate_type.py
Y
VirtualSystemMigrationService - 05_migratable_host_errs.py
Y
VirtualSystemSettingDataComponent - 01_forward.py
N
Best,
Regards
Daisy (运国莲)
VSM Team, China Systems & Technology Labs (CSTL)
E-mail: yunguol(a)cn.ibm.com
TEL: (86)-21-60922144
Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203
16 years, 5 months
[PATCH] [TEST] 2# Update VirtualSystemSettingDataComponent.01 for LXC support
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1216192956 25200
# Node ID 4fab30cea82ff4b689b16594e0db865a5366ec65
# Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d
[TEST] 2# Update VirtualSystemSettingDataComponent.01 for LXC support
The test defines non-bootloader guests for all platform types, also remove the
part of thet test that verifies the bootloader
Updates from 1 to 2:
Pass test_disk and test_mac as parameters into init_list() function.
On the assoc_values(), I will update it to call compare_all_prop() when
Kaitlin's patch applied in the tree.
diff -r 64abdd1495dc -r 4fab30cea82f suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Fri Jul 11 00:42:35 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Wed Jul 16 00:22:36 2008 -0700
@@ -53,31 +53,29 @@ from XenKvmLib import enumclass
from XenKvmLib import enumclass
from VirtLib import utils
from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
-from XenKvmLib.test_xml import testxml_bl
-from XenKvmLib.test_xml import xml_get_dom_bootloader
from CimTest import Globals
from XenKvmLib import assoc
+from XenKvmLib import vxml
+from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, do_main
from CimTest.ReturnCodes import FAIL, PASS
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "VSSDC_dom"
test_vcpus = 2
test_mac = "00:11:22:33:44:aa"
test_disk = 'xvda'
-status = 0
-VSType = "Xen"
-
-def init_list():
+
+def init_list(test_disk, test_mac, virt='Xen'):
"""
Creating the lists that will be used for comparisons.
"""
- rlist = ['Xen_DiskResourceAllocationSettingData',
- 'Xen_MemResourceAllocationSettingData',
- 'Xen_NetResourceAllocationSettingData',
- 'Xen_ProcResourceAllocationSettingData'
+ rlist = [get_typed_class(virt, 'DiskResourceAllocationSettingData'),
+ get_typed_class(virt, 'MemResourceAllocationSettingData'),
+ get_typed_class(virt, 'NetResourceAllocationSettingData'),
+ get_typed_class(virt, 'ProcResourceAllocationSettingData')
]
prop_list = {rlist[0] : "%s/%s" % (test_dom, test_disk),
@@ -85,7 +83,10 @@ def init_list():
rlist[2] : "%s/%s" % (test_dom, test_mac),
rlist[3] : "%s/%s" % (test_dom, "proc")
}
-
+ if virt == 'LXC':
+ rlist = [get_typed_class(virt, 'MemResourceAllocationSettingData')]
+ prop_list = {rlist[0] : "%s/%s" % (test_dom, "mem")}
+
return prop_list
def build_vssd_info(ip, vssd):
@@ -93,14 +94,14 @@ def build_vssd_info(ip, vssd):
Creating the vssd fileds lists that will be used for comparisons.
"""
- if vssd.Bootloader == "" or vssd.Caption == "" or \
+ if 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")
test_domain_function(test_dom, ip, "undefine")
return FAIL
- vssd_vals = {'Bootloader' : vssd.Bootloader,
+ vssd_vals = {
'Caption' : vssd.Caption,
'InstanceID' : vssd.InstanceID,
'ElementName' : vssd.ElementName,
@@ -143,23 +144,33 @@ def main():
status = FAIL
destroy_and_undefine_all(options.ip)
- test_xml = testxml_bl(test_dom, vcpus = test_vcpus, \
- mac = test_mac, disk = test_disk, \
- server = options.ip,\
- gtype = 0)
- ret = test_domain_function(test_xml, options.ip, cmd = "define")
+ prop_list = init_list(test_disk, test_mac, options.virt)
+ virt_xml = vxml.get_class(options.virt)
+ if options.virt == 'LXC':
+ cxml = virt_xml(test_dom)
+ else:
+ cxml = virt_xml(test_dom, vcpus = test_vcpus, \
+ mac = test_mac, disk = test_disk)
+ ret = cxml.define(options.ip)
if not ret:
logger.error("Failed to define the dom: %s", test_dom)
return FAIL
- instIdval = "%s:%s" % (VSType, test_dom)
+ if options.virt == 'XenFV':
+ instIdval = "Xen:%s" % test_dom
+ else:
+ instIdval = "%s:%s" % (options.virt, test_dom)
+
keyname = "InstanceID"
key_list = { 'InstanceID' : instIdval }
+ vssd_cn = get_typed_class(options.virt, 'VirtualSystemSettingData')
+
try:
vssd = enumclass.getInstance(options.ip, \
- enumclass.Xen_VirtualSystemSettingData, \
- key_list)
+ 'VirtualSystemSettingData', \
+ key_list,
+ options.virt)
if vssd is None:
logger.error("VSSD instance for %s not found" % test_dom)
test_domain_function(test_dom, options.ip, "undefine")
@@ -168,21 +179,19 @@ def main():
vssd_vals = build_vssd_info(options.ip, vssd)
except Exception, detail :
- logger.error(Globals.CIM_ERROR_GETINSTANCE, \
- 'Xen_VirtualSystemSettingData')
+ logger.error(Globals.CIM_ERROR_GETINSTANCE, vssd_cn)
logger.error("Exception : %s" % detail)
- test_domain_function(test_dom, options.ip, "undefine")
- return FAIL
-
- prop_list = init_list()
+ cxml.undefine(options.ip)
+ return FAIL
+
try:
# Looping through the RASD_cllist, call association
# Xen_VirtualSystemSettingDataComponent with each class in RASD_cllist
- an = 'Xen_VirtualSystemSettingDataComponent'
+ an = get_typed_class(options.virt, 'VirtualSystemSettingDataComponent')
for rasd_cname, prop in prop_list.iteritems():
assoc_info = assoc.Associators(options.ip, an, rasd_cname,
- InstanceID = prop)
+ options.virt, InstanceID = prop)
# Verify the association fields returned for particular rasd_cname.
status = assoc_values(options.ip, assoc_info, rasd_cname, an,
vssd_vals)
@@ -194,7 +203,7 @@ def main():
logger.error("Exception : %s" % detail)
status = FAIL
- test_domain_function(test_dom, options.ip, "undefine")
+ cxml.undefine(options.ip)
return status
if __name__ == "__main__":
16 years, 5 months
[PATCH] [TEST] #3 Updating 01_forward.py of EAFP
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1216218212 25200
# Node ID c2a1ddb060ced4b86c1624681500efcf87bb667b
# Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d
[TEST] #3 Updating 01_forward.py of EAFP
Changes:
--------
>From 2 to 3:
------------
1) Removed the key param for get_inst()
2) Removed the init_list() , instead hardcoded the list.
3) Removed get_keys()which is no longer needed.
4) Removed the break stmt and returned FAIL directly.
5) Removed unnecessary status variables.
>From 1 to 2:
------------
1) Added support for LXC.
2) Made only EAFP pool specific checks.
3) Removed eafp_list() used previously, instead added get_id to create the pool list .
4) Removed print_error().
5) Removed get_id instead used get_inst.
6) Added support for Memory, Processor, NetworkPort to enumclass.py.
Patch 1:
-------
1) Modifying the tc to support XenFV and KVM.
2) Modified get_keys() to use proper SystemCreationClassName.
3) Added functions get_id to get the instances for different logical devices so that the DeviceID of the instances can be used
in the init_list().
4) Added init_list() function to create a list of inputs for the EAFP association.
5) Added eafp_list() to create a list of pool values that will be used to verify the return values from the EAFP association.
6) Added the function verify_eafp_values() to call assocation on EAFP and verify the return values.
7) Included cleanup_restore().
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 64abdd1495dc -r c2a1ddb060ce suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Fri Jul 11 00:42:35 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Wed Jul 16 07:23:32 2008 -0700
@@ -42,165 +42,150 @@
import sys
import pywbem
-from XenKvmLib.test_xml import testxml, testxml_bridge
-from VirtLib import utils
-from XenKvmLib import assoc
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
+from XenKvmLib.assoc import Associators
+from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib import devices
-from CimTest import Globals
-from CimTest.Globals import do_main
-from VirtLib.live import network_by_bridge
-from CimTest.ReturnCodes import PASS, FAIL, SKIP
+from XenKvmLib.enumclass import getInstance
+from CimTest.Globals import CIM_ERROR_ASSOCIATORS, CIM_ERROR_GETINSTANCE
+from XenKvmLib.vxml import get_class
+from XenKvmLib.common_util import create_diskpool_conf, cleanup_restore
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.logicaldevices import field_err
+from CimTest.Globals import do_main, logger
+from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "hd_domain"
test_mac = "00:11:22:33:44:aa"
test_vcpus = 1
-test_disk = 'xvda'
+def get_inst(server, virt, cn, key_list):
+ inst = None
+ try:
+ inst = getInstance(server, cn, key_list, virt)
-def print_error(cn, detail):
- Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, cn)
- Globals.logger.error("Exception: %s", detail)
+ except Exception, details:
+ logger.error("Exception %s" % details)
+ return None
-def get_keys(cn, device_id):
- id = "%s/%s" % (test_dom, device_id)
+ if inst is None:
+ logger.error("Expected at least one %s instance" % cn)
+ return None
- key_list = { 'DeviceID' : id,
- 'CreationClassName' : cn,
- 'SystemName' : test_dom,
- 'SystemCreationClassName' : "Xen_ComputerSystem"
- }
+ return inst
- return key_list
+def get_pool_details(server, virt, vsxml, diskid):
+ gi_inst_list = {}
+ inst = None
+ if virt != 'LXC':
+ virt_network = vsxml.xml_get_net_network()
+ keys = {
+ 'DiskPool' : diskid,
+ 'ProcessorPool' : 'ProcessorPool/0' ,
+ 'MemoryPool' : 'MemoryPool/0',
+ 'NetworkPool' : 'NetworkPool/%s' %virt_network
+ }
+ else:
+ keys = {
+ 'MemoryPool' : 'MemoryPool/0',
+ }
+
+ for cn, k in keys.iteritems():
+ key_list = {"InstanceID" : k}
+ inst = get_inst(server, virt, cn, key_list)
+ if inst is None:
+ cleanup_restore(server, virt)
+ vsxml.destroy(server)
+ return FAIL, gi_inst_list
+ cn = get_typed_class(virt, cn)
+ gi_inst_list[cn] = { 'InstanceID' : inst.InstanceID,
+ 'PoolID' : inst.PoolID
+ }
+ return PASS, gi_inst_list
+
+def verify_eafp_values(server, virt, in_pllist, gi_inst_list):
+ # Looping through the in_pllist to get association for devices.
+ an = get_typed_class(virt, "ElementAllocatedFromPool")
+ sccn = get_typed_class(virt, "ComputerSystem")
+ for cn, devid in sorted(in_pllist.iteritems()):
+ try:
+ assoc_info = Associators(server, an, cn,
+ DeviceID = devid,
+ CreationClassName = cn,
+ SystemName = test_dom,
+ SystemCreationClassName = sccn,
+ virt=virt)
+ if len(assoc_info) != 1:
+ logger.error("%s returned %i ResourcePool objects for "
+ "domain '%s'", an, len(assoc_info),
+ test_dom)
+ return FAIL
+ assoc_eafp_info = assoc_info[0]
+ CCName = assoc_eafp_info.classname
+ gi_inst = gi_inst_list[CCName]
+ if assoc_eafp_info['InstanceID'] != gi_inst['InstanceID']:
+ field_err(assoc_eafp_info, gi_inst, 'InstanceID')
+ return FAIL
+ if assoc_eafp_info['PoolID'] != gi_inst['PoolID']:
+ field_err(assoc_eafp_info, gi_inst, 'PoolID')
+ return FAIL
+ except Exception, detail:
+ logger.error(CIM_ERROR_ASSOCIATORS, an)
+ logger.error("Exception: %s", detail)
+ cleanup_restore(server, virt)
+ return FAIL
+ return PASS
+
@do_main(sup_types)
def main():
options = main.options
- status = PASS
- idx = 0
+ server = options.ip
+ virt = options.virt
+ if virt == 'Xen':
+ test_disk = 'xvda'
+ else:
+ test_disk = 'hda'
-# Getting the VS list and deleting the test_dom if it already exists.
- destroy_and_undefine_all(options.ip)
+ # Getting the VS list and deleting the test_dom if it already exists.
+ 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)
- test_xml, bridge = testxml_bridge(test_dom, vcpus = test_vcpus, \
- mac = test_mac, disk = test_disk, \
- server = options.ip)
- if bridge == None:
- Globals.logger.error("Unable to find virtual bridge")
- return SKIP
+ # Verify DiskPool on machine
+ status, diskid = create_diskpool_conf(server, virt)
+ if status != PASS:
+ return status
+ ret = vsxml.create(server)
+ if not ret:
+ logger.error("Failed to Create the dom: '%s'", test_dom)
+ return FAIL
+
+ mem_cn = get_typed_class(virt, "Memory")
+ ldlist = {
+ mem_cn : "%s/%s" % (test_dom, "mem"),
+ }
- if test_xml == None:
- Globals.logger.error("Guest xml not created properly")
- return FAIL
+ if virt != 'LXC':
+ disk_cn = get_typed_class(virt, "LogicalDisk")
+ net_cn = get_typed_class(virt, "NetworkPort")
+ proc_cn = get_typed_class(virt, "Processor")
+ ldlist[disk_cn] = "%s/%s" % (test_dom, test_disk)
+ ldlist[net_cn] = "%s/%s" % (test_dom, test_mac)
+ ldlist[proc_cn] = "%s/%s" % (test_dom, "0")
- virt_network = network_by_bridge(bridge, options.ip)
- if virt_network == None:
- Globals.logger.error("No virtual network found for bridge %s", bridge)
- return SKIP
-
- ret = test_domain_function(test_xml, options.ip, cmd = "create")
- if not ret:
- Globals.logger.error("Failed to Create the dom: %s", test_dom)
- return FAIL
-
- try:
- cn = "Xen_LogicalDisk"
- key_list = get_keys(cn, test_disk)
- disk = devices.Xen_LogicalDisk(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
-
- try:
- cn = "Xen_Memory"
- key_list = get_keys(cn, "mem")
- mem = devices.Xen_Memory(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
-
- try:
- cn = "Xen_NetworkPort"
- key_list = get_keys(cn, test_mac)
- net = devices.Xen_NetworkPort(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
-
- try:
- cn = "Xen_Processor"
- key_list = get_keys(cn, "0")
- proc = devices.Xen_Processor(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
-
- netpool_id = "NetworkPool/%s" % virt_network
-
- lelist = {
- "Xen_LogicalDisk" : disk.DeviceID, \
- "Xen_Memory" : mem.DeviceID, \
- "Xen_NetworkPort" : net.DeviceID, \
- "Xen_Processor" : proc.DeviceID
- }
- poollist = [
- "Xen_DiskPool", \
- "Xen_MemoryPool", \
- "Xen_NetworkPool", \
- "Xen_ProcessorPool"
- ]
- poolval = [
- "DiskPool/foo", \
- "MemoryPool/0", \
- netpool_id, \
- "ProcessorPool/0"
- ]
-
- sccn = "Xen_ComputerSystem"
- for cn, devid in sorted(lelist.items()):
- try:
- assoc_info = assoc.Associators(options.ip, \
- "Xen_ElementAllocatedFromPool",
- cn,
- DeviceID = devid,
- CreationClassName = cn,
- SystemName = test_dom,
- SystemCreationClassName = sccn)
- if len(assoc_info) != 1:
- Globals.logger.error("Xen_ElementAllocatedFromPool returned %i\
- ResourcePool objects for domain '%s'", len(assoc_info), test_dom)
- status = FAIL
- break
-
- if assoc_info[0].classname != poollist[idx]:
- Globals.logger.error("Classname Mismatch")
- Globals.logger.error("Returned %s instead of %s", \
- assoc_info[0].classname, \
- poollist[idx])
- status = FAIL
-
- if assoc_info[0]['InstanceID'] != poolval[idx]:
- Globals.logger.error("InstanceID Mismatch")
- Globals.logger.error("Returned %s instead of %s", \
- assoc_info[0]['InstanceID'], \
- poolval[idx])
- status = FAIL
-
- if status != PASS:
- break
- else:
- idx = idx + 1
-
- except Exception, detail:
- Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \
- 'Xen_ElementAllocatedFromPool')
- Globals.logger.error("Exception: %s", detail)
- status = FAIL
-
- ret = test_domain_function(test_dom, options.ip, \
- cmd = "destroy")
+ status, gi_inst_list = get_pool_details(server, virt, vsxml, diskid)
+ if status != PASS:
+ return status
+
+ status = verify_eafp_values(server, virt, ldlist, gi_inst_list)
+ cleanup_restore(server, virt)
+ vsxml.destroy(server)
return status
if __name__ == "__main__":
diff -r 64abdd1495dc -r c2a1ddb060ce suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jul 11 00:42:35 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Wed Jul 16 07:23:32 2008 -0700
@@ -117,6 +117,30 @@ class Xen_LogicalDisk(CIM_LogicalDevice)
pass
class KVM_LogicalDisk(CIM_LogicalDevice):
+ pass
+
+class Xen_Memory(CIM_LogicalDevice):
+ pass
+
+class KVM_Memory(CIM_LogicalDevice):
+ pass
+
+class LXC_Memory(CIM_LogicalDevice):
+ pass
+
+class LXC_Memory(CIM_LogicalDevice):
+ pass
+
+class Xen_Processor(CIM_LogicalDevice):
+ pass
+
+class KVM_Processor(CIM_LogicalDevice):
+ pass
+
+class Xen_NetworkPort(CIM_LogicalDevice):
+ pass
+
+class KVM_NetworkPort(CIM_LogicalDevice):
pass
class Xen_MemoryPool(CIM_ResourcePool):
16 years, 5 months
CimTest Report for KVM on F9 16-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 : 637
CIMTEST : 243
=======================================================
PASS : 110
FAIL : 1
XFAIL : 4
SKIP : 15
-----------------
Total : 130
=======================================================
Here is one of the tc that failed
ComputerSystemIndication - 01_created_indication.py: FAIL
ERROR - Waited too long for indication
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: 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
libvir: QEMU error : Domain not found
libvir: Domain error : invalid domain pointer in virDomainFree
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: FAIL
ERROR - Waited too long for indication
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
libvir: QEMU error : Domain not found
libvir: Domain error : invalid domain pointer in virDomainFree
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
libvir: QEMU error : Domain not found
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
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
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: 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
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
Profile - 03_rprofile_gi_errs.py: PASS
RASD - 01_verify_rasd_fields.py: PASS
RASD - 02_enum.py: PASS
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
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 Updating 01_forward.py of EAFP
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1216118958 25200
# Node ID a379943366703def9ecfe0a03779f91d3556a244
# Parent 64abdd1495dc05e69061151baf2ea25a682e8d8d
[TEST] #2 Updating 01_forward.py of EAFP
Changes:
--------
>From 1 to 2:
------------
1) Added support for LXC.
2) Made only EAFP pool specific checks.
3) Removed eafp_list() used previously, instead added get_id to create the pool list .
4) Removed print_error().
5) Removed get_id instead used get_inst.
6) Added support for Memory, Processor, NetworkPort to enumclass.py.
Patch 1:
-------
1) Modifying the tc to support XenFV and KVM.
2) Modified get_keys() to use proper SystemCreationClassName.
3) Added functions get_id to get the instances for different logical devices so that the DeviceID of the instances can be used
in the init_list().
4) Added init_list() function to create a list of inputs for the EAFP association.
5) Added eafp_list() to create a list of pool values that will be used to verify the return values from the EAFP association.
6) Added the function verify_eafp_values() to call assocation on EAFP and verify the return values.
7) Included cleanup_restore().
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 64abdd1495dc -r a37994336670 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Fri Jul 11 00:42:35 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Tue Jul 15 03:49:18 2008 -0700
@@ -42,165 +42,178 @@
import sys
import pywbem
-from XenKvmLib.test_xml import testxml, testxml_bridge
-from VirtLib import utils
-from XenKvmLib import assoc
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
+from XenKvmLib.assoc import Associators
+from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib import devices
-from CimTest import Globals
-from CimTest.Globals import do_main
-from VirtLib.live import network_by_bridge
-from CimTest.ReturnCodes import PASS, FAIL, SKIP
+from XenKvmLib.enumclass import getInstance
+from CimTest.Globals import CIM_ERROR_ASSOCIATORS, CIM_ERROR_GETINSTANCE
+from XenKvmLib.vxml import get_class
+from XenKvmLib.common_util import create_diskpool_conf, cleanup_restore
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.logicaldevices import field_err
+from CimTest.Globals import do_main, logger
+from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "hd_domain"
test_mac = "00:11:22:33:44:aa"
test_vcpus = 1
-test_disk = 'xvda'
+def get_keys(virt, cn, id):
+ sccn = get_typed_class(virt, "ComputerSystem")
+ cn = get_typed_class(virt, cn)
+ key_list = { 'DeviceID' : id,
+ 'CreationClassName' : cn,
+ 'SystemName' : test_dom,
+ 'SystemCreationClassName' : sccn
+ }
+ return key_list
-def print_error(cn, detail):
- Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, cn)
- Globals.logger.error("Exception: %s", detail)
+def get_inst(server, virt, cn, key, key_list):
+ inst = None
+ try:
+ inst = getInstance(server, cn, key_list, virt)
-def get_keys(cn, device_id):
- id = "%s/%s" % (test_dom, device_id)
+ except Exception, details:
+ logger.error("Exception %s" % details)
+ return None
- key_list = { 'DeviceID' : id,
- 'CreationClassName' : cn,
- 'SystemName' : test_dom,
- 'SystemCreationClassName' : "Xen_ComputerSystem"
- }
+ if inst is None:
+ logger.error("Expected at least one %s instance" % cn)
+ return None
- return key_list
+ return inst
+
+def init_list(server, virt, vsxml, test_disk):
+ lelist = {}
+ if virt != 'LXC':
+ cn_keys_list = {
+ "LogicalDisk" : "%s/%s" % (test_dom, test_disk),
+ "Memory" : "%s/%s" % (test_dom, "mem"),
+ "NetworkPort" : "%s/%s" % (test_dom, test_mac),
+ "Processor" : "%s/%s" % (test_dom, "0")
+ }
+ else:
+ cn_keys_list = {
+ "Memory" : "%s/%s" % (test_dom, "mem"),
+ }
+
+ for cname, id in cn_keys_list.items():
+ key_list = get_keys(virt, cname, id)
+ inst = get_inst(server, virt, cname, id, key_list)
+ if inst is None :
+ cleanup_restore(server, virt)
+ vsxml.destroy(server)
+ return FAIL, lelist
+ lelist [inst.CreationClassName] = inst.DeviceID
+ return PASS, lelist
+
+def get_pool_details(server, virt, vsxml, diskid):
+ gi_inst_list = {}
+ inst = None
+ if virt != 'LXC':
+ virt_network = vsxml.xml_get_net_network()
+ keys = {
+ 'DiskPool' : diskid,
+ 'ProcessorPool' : 'ProcessorPool/0' ,
+ 'MemoryPool' : 'MemoryPool/0',
+ 'NetworkPool' : 'NetworkPool/%s' %virt_network
+ }
+ else:
+ keys = {
+ 'MemoryPool' : 'MemoryPool/0',
+ }
+
+ for cn, k in keys.iteritems():
+ key_list = {"InstanceID" : k}
+ inst = get_inst(server, virt, cn, k, key_list)
+ if inst is None:
+ cleanup_restore(server, virt)
+ vsxml.destroy(server)
+ return FAIL, gi_inst_list
+ cn = get_typed_class(virt, cn)
+ gi_inst_list[cn] = { 'InstanceID' : inst.InstanceID,
+ 'PoolID' : inst.PoolID
+ }
+ return PASS, gi_inst_list
+
+def verify_eafp_values(server, virt, in_pllist, gi_inst_list):
+ # Looping through the in_pllist to get association for devices.
+ status = PASS
+ an = get_typed_class(virt, "ElementAllocatedFromPool")
+ sccn = get_typed_class(virt, "ComputerSystem")
+ for cn, devid in sorted(in_pllist.iteritems()):
+ try:
+ assoc_info = Associators(server, an, cn,
+ DeviceID = devid,
+ CreationClassName = cn,
+ SystemName = test_dom,
+ SystemCreationClassName = sccn,
+ virt=virt)
+ if len(assoc_info) != 1:
+ logger.error("%s returned %i ResourcePool objects for "
+ "domain '%s'", an, len(assoc_info),
+ test_dom)
+ status = FAIL
+ break
+ assoc_eafp_info = assoc_info[0]
+ CCName = assoc_eafp_info.classname
+ gi_inst = gi_inst_list[CCName]
+ if assoc_eafp_info['InstanceID'] != gi_inst['InstanceID']:
+ field_err(assoc_eafp_info, gi_inst, 'InstanceID')
+ return FAIL
+ if assoc_eafp_info['PoolID'] != gi_inst['PoolID']:
+ field_err(assoc_eafp_info, gi_inst, 'PoolID')
+ return FAIL
+ except Exception, detail:
+ logger.error(CIM_ERROR_ASSOCIATORS, an)
+ logger.error("Exception: %s", detail)
+ cleanup_restore(server, virt)
+ status = FAIL
+ return status
+
@do_main(sup_types)
def main():
options = main.options
+ server = options.ip
+ virt = options.virt
status = PASS
- idx = 0
+ if virt == 'Xen':
+ test_disk = 'xvda'
+ else:
+ test_disk = 'hda'
-# Getting the VS list and deleting the test_dom if it already exists.
- destroy_and_undefine_all(options.ip)
+ # Getting the VS list and deleting the test_dom if it already exists.
+ 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)
- test_xml, bridge = testxml_bridge(test_dom, vcpus = test_vcpus, \
- mac = test_mac, disk = test_disk, \
- server = options.ip)
- if bridge == None:
- Globals.logger.error("Unable to find virtual bridge")
- return SKIP
-
- if test_xml == None:
- Globals.logger.error("Guest xml not created properly")
- return FAIL
-
- virt_network = network_by_bridge(bridge, options.ip)
- if virt_network == None:
- Globals.logger.error("No virtual network found for bridge %s", bridge)
- return SKIP
-
- ret = test_domain_function(test_xml, options.ip, cmd = "create")
+ # Verify DiskPool on machine
+ status, diskid = create_diskpool_conf(server, virt)
+ if status != PASS:
+ return status
+ ret = vsxml.create(server)
if not ret:
- Globals.logger.error("Failed to Create the dom: %s", test_dom)
+ logger.error("Failed to Create the dom: '%s'", test_dom)
return FAIL
- try:
- cn = "Xen_LogicalDisk"
- key_list = get_keys(cn, test_disk)
- disk = devices.Xen_LogicalDisk(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
+ status, lelist = init_list(server, virt, vsxml, test_disk)
+ if status != PASS:
+ return status
- try:
- cn = "Xen_Memory"
- key_list = get_keys(cn, "mem")
- mem = devices.Xen_Memory(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
-
- try:
- cn = "Xen_NetworkPort"
- key_list = get_keys(cn, test_mac)
- net = devices.Xen_NetworkPort(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
-
- try:
- cn = "Xen_Processor"
- key_list = get_keys(cn, "0")
- proc = devices.Xen_Processor(options.ip, key_list)
- except Exception,detail:
- print_error(cn, detail)
- return FAIL
-
- netpool_id = "NetworkPool/%s" % virt_network
-
- lelist = {
- "Xen_LogicalDisk" : disk.DeviceID, \
- "Xen_Memory" : mem.DeviceID, \
- "Xen_NetworkPort" : net.DeviceID, \
- "Xen_Processor" : proc.DeviceID
- }
- poollist = [
- "Xen_DiskPool", \
- "Xen_MemoryPool", \
- "Xen_NetworkPool", \
- "Xen_ProcessorPool"
- ]
- poolval = [
- "DiskPool/foo", \
- "MemoryPool/0", \
- netpool_id, \
- "ProcessorPool/0"
- ]
-
- sccn = "Xen_ComputerSystem"
- for cn, devid in sorted(lelist.items()):
- try:
- assoc_info = assoc.Associators(options.ip, \
- "Xen_ElementAllocatedFromPool",
- cn,
- DeviceID = devid,
- CreationClassName = cn,
- SystemName = test_dom,
- SystemCreationClassName = sccn)
- if len(assoc_info) != 1:
- Globals.logger.error("Xen_ElementAllocatedFromPool returned %i\
- ResourcePool objects for domain '%s'", len(assoc_info), test_dom)
- status = FAIL
- break
-
- if assoc_info[0].classname != poollist[idx]:
- Globals.logger.error("Classname Mismatch")
- Globals.logger.error("Returned %s instead of %s", \
- assoc_info[0].classname, \
- poollist[idx])
- status = FAIL
-
- if assoc_info[0]['InstanceID'] != poolval[idx]:
- Globals.logger.error("InstanceID Mismatch")
- Globals.logger.error("Returned %s instead of %s", \
- assoc_info[0]['InstanceID'], \
- poolval[idx])
- status = FAIL
-
- if status != PASS:
- break
- else:
- idx = idx + 1
-
- except Exception, detail:
- Globals.logger.error(Globals.CIM_ERROR_ASSOCIATORS, \
- 'Xen_ElementAllocatedFromPool')
- Globals.logger.error("Exception: %s", detail)
- status = FAIL
-
- ret = test_domain_function(test_dom, options.ip, \
- cmd = "destroy")
+ status, gi_inst_list = get_pool_details(server, virt, vsxml, diskid)
+ if status != PASS:
+ return status
+
+ status = verify_eafp_values(server, virt, lelist, gi_inst_list)
+ cleanup_restore(server, virt)
+ vsxml.destroy(server)
return status
if __name__ == "__main__":
diff -r 64abdd1495dc -r a37994336670 suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Fri Jul 11 00:42:35 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue Jul 15 03:49:18 2008 -0700
@@ -117,6 +117,30 @@ class Xen_LogicalDisk(CIM_LogicalDevice)
pass
class KVM_LogicalDisk(CIM_LogicalDevice):
+ pass
+
+class Xen_Memory(CIM_LogicalDevice):
+ pass
+
+class KVM_Memory(CIM_LogicalDevice):
+ pass
+
+class LXC_Memory(CIM_LogicalDevice):
+ pass
+
+class LXC_Memory(CIM_LogicalDevice):
+ pass
+
+class Xen_Processor(CIM_LogicalDevice):
+ pass
+
+class KVM_Processor(CIM_LogicalDevice):
+ pass
+
+class Xen_NetworkPort(CIM_LogicalDevice):
+ pass
+
+class KVM_NetworkPort(CIM_LogicalDevice):
pass
class Xen_MemoryPool(CIM_ResourcePool):
16 years, 5 months
[PATCH] [TEST] #2 Remove guest creation from LogicalDisk - 02_nodevs.py
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1216138782 25200
# Node ID 329b99c8516d4f0ae9ae49ed63ac0f4469917931
# Parent aee2bda69644fbf01ec3fbe038ecf6c52d63555a
[TEST] #2 Remove guest creation from LogicalDisk - 02_nodevs.py.
The point of this test is to ensure no devices are returned from EnumerateInstances() in the case where no guest is defined (or in the case where only Domain-0 is defined).
Also add support for LXC.
In the case where devices.enumerate() encountered a CIM error, raise an exception instead of printing an error.
Updates from 1 to 2:
-Fix spacing in clean_system()
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r aee2bda69644 -r 329b99c8516d suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Jul 15 09:14:20 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Tue Jul 15 09:19:42 2008 -0700
@@ -25,21 +25,23 @@
import sys
import pywbem
-from VirtLib import utils
from VirtLib import live
from XenKvmLib import devices
-from XenKvmLib.classes import get_typed_class
-from XenKvmLib.vxml import XenXML, KVMXML, get_class
-from XenKvmLib.test_doms import define_test_domain, undefine_test_domain
-from XenKvmLib.test_xml import testxml
-from CimTest.Globals import logger, do_main
+from CimTest.Globals import logger, do_main, CIM_ERROR_ENUMERATE
+from CimTest.ReturnCodes import PASS, FAIL, SKIP
-sup_types = ['Xen', 'KVM', 'XenFV']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "test_domain"
def clean_system(host, virt='Xen'):
l = live.domain_list(host, virt)
- if len(l) > 1:
+
+ if virt == "XenFV" or virt == "Xen":
+ if len(l) > 1:
+ return False
+ else:
+ return True
+ elif len(l) > 0:
return False
else:
return True
@@ -49,31 +51,27 @@
options = main.options
if not clean_system(options.ip, options.virt):
logger.error("System has defined domains; unable to run")
- return 2
+ return SKIP
- if options.virt == 'Xen':
- test_dev = 'xvda'
- else:
- test_dev = 'hda'
+ key_list = ["DeviceID", "CreationClassName", "SystemName",
+ "SystemCreationClassName"]
- vsxml = get_class(options.virt)(test_dom, disk=test_dev)
- ret = vsxml.define(options.ip)
- if not ret:
- logger.error("Failed to Define the dom: %s", test_dom)
+ cn = "LogicalDisk"
+
+ try:
+ devs = devices.enumerate(options.ip, cn, key_list, options.virt)
+
+ except Exception, details:
+ logger.error(CIM_ERROR_ENUMERATE, cn)
+ logger.error(details)
return FAIL
- devid = "%s/%s" % (test_dom, test_dev)
+ if len(devs) != 0:
+ logger.error("%s returned %d instead of empty list" % (cn, len(devs)))
+ status = FAIL
+ else:
+ status = PASS
- status = 0
- key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"]
-
- devs = devices.enumerate(options.ip, 'LogicalDisk', key_list)
- if devs.__class__ == str:
- logger.error("Got error instead of empty list: %s" % devs)
- status = 1
-
- vsxml.undefine(options.ip)
-
return status
if __name__ == "__main__":
diff -r aee2bda69644 -r 329b99c8516d suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Jul 15 09:14:20 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Jul 15 09:19:42 2008 -0700
@@ -85,6 +85,9 @@
class KVM_LogicalDisk(CIM_LogicalDisk):
pass
+class LXC_LogicalDisk(CIM_LogicalDisk):
+ pass
+
class Xen_NetworkPort(CIM_NetworkPort):
pass
@@ -123,7 +126,7 @@
try:
names = conn.EnumerateInstanceNames(devtype.__name__)
except pywbem.CIMError, arg:
- print arg[1]
+ raise Exception("%s" % arg[1])
return list
for name in names:
16 years, 5 months