Test Run Summary (May 19 2009): KVM on Fedora release 10 (Cambridge) with sfcb
by Guo Lian Yun
=================================================
Test Run Summary (May 19 2009): KVM on Fedora release 10 (Cambridge) with
sfcb
=================================================
Distro: Fedora release 10 (Cambridge)
Kernel: 2.6.27.15-170.2.24.fc10.x86_64
libvirt: 0.4.5
Hypervisor: QEMU 0.9.1
CIMOM: sfcb sfcbd 1.3.4preview
Libvirt-cim revision: 875
Libvirt-cim changeset: cde25ad65c74
Cimtest revision: 683
Cimtest changeset: 6dc2d815e480
=================================================
FAIL : 5
XFAIL : 4
SKIP : 9
PASS : 135
-----------------
Total : 153
=================================================
FAIL Test Summary:
ComputerSystemIndication - 01_created_indication.py: FAIL
HostSystem - 03_hs_to_settdefcap.py: FAIL
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
SettingsDefineCapabilities - 01_forward.py: FAIL
=================================================
XFAIL Test Summary:
ComputerSystem - 32_start_reboot.py: XFAIL
ComputerSystem - 33_suspend_reboot.py: XFAIL
VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL
VirtualSystemManagementService - 16_removeresource.py: XFAIL
=================================================
SKIP Test Summary:
ComputerSystem - 02_nosystems.py: SKIP
LogicalDisk - 02_nodevs.py: SKIP
VSSD - 02_bootldr.py: SKIP
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP
VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP
VirtualSystemMigrationService - 08_remote_restart_resume_migration.py:
SKIP
=================================================
Full report:
--------------------------------------------------------------------
AllocationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 01_enum.py: PASS
--------------------------------------------------------------------
ComputerSystem - 02_nosystems.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
ComputerSystem - 03_defineVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 04_defineStartVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 05_activate_defined_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 06_paused_active_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 22_define_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 23_pause_pause.py: PASS
--------------------------------------------------------------------
ComputerSystem - 27_define_pause_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: XFAIL
ERROR - Got CIM error Unable to reboot domain: this function is
not supported by the hypervisor: virDomainReboot with return code 1
ERROR - Exception: Unable reboot dom 'cs_test_domain'
InvokeMethod(RequestStateChange): Unable to reboot domain: this function
is not supported by the hypervisor: virDomainReboot
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: XFAIL
ERROR - Got CIM error State not supported with return code 7
ERROR - Exception: Unable Suspend dom 'test_domain'
InvokeMethod(RequestStateChange): State not supported
Bug:<00012>
--------------------------------------------------------------------
ComputerSystem - 35_start_reset.py: PASS
--------------------------------------------------------------------
ComputerSystem - 40_RSC_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 41_cs_to_settingdefinestate.py: PASS
--------------------------------------------------------------------
ComputerSystem - 42_cs_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystemIndication - 01_created_indication.py: FAIL
ERROR - Exception : Request Failed: 200
Traceback (most recent call last):
File "./lib/XenKvmLib/const.py", line 139, in do_try
File "01_created_indication.py", line 146, in main
sub_list, ind_names, dict = sub_ind(ip, virt)
File "01_created_indication.py", line 60, in sub_ind
sub.subscribe(dict['default_url'], dict['default_auth'])
File
"/data/users/daisy/cimtest/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py",
line 345, in subscribe
"CreateInstance", auth_hdr)
File
"/data/users/daisy/cimtest/suites/libvirt-cim/lib/XenKvmLib/indication_tester.py",
line 330, in __do_cimpost
(resp.status, resp.reason))
Exception: Request Failed: 200
ERROR - None
--------------------------------------------------------------------
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: FAIL
ERROR - 'KVM_SettingsDefineCapabilities' returned 8 RASD
objects instead of 4
Class not found
--------------------------------------------------------------------
HostSystem - 04_hs_to_EAPF.py: PASS
--------------------------------------------------------------------
HostSystem - 05_hs_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 06_hs_to_vsms.py: PASS
--------------------------------------------------------------------
HostedAccessPoint - 01_forward.py: PASS
--------------------------------------------------------------------
HostedAccessPoint - 02_reverse.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
--------------------------------------------------------------------
KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS
--------------------------------------------------------------------
LogicalDisk - 01_disk.py: PASS
--------------------------------------------------------------------
LogicalDisk - 02_nodevs.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
LogicalDisk - 03_ld_gi_errs.py: PASS
--------------------------------------------------------------------
Memory - 01_memory.py: PASS
--------------------------------------------------------------------
Memory - 02_defgetmem.py: PASS
--------------------------------------------------------------------
Memory - 03_mem_gi_errs.py: PASS
--------------------------------------------------------------------
NetworkPort - 01_netport.py: PASS
--------------------------------------------------------------------
NetworkPort - 02_np_gi_errors.py: PASS
--------------------------------------------------------------------
NetworkPort - 03_user_netport.py: 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: PASS
--------------------------------------------------------------------
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
--------------------------------------------------------------------
RASD - 04_disk_rasd_size.py: PASS
--------------------------------------------------------------------
RASD - 05_disk_rasd_emu_type.py: PASS
--------------------------------------------------------------------
RedirectionService - 01_enum_crs.py: PASS
--------------------------------------------------------------------
RedirectionService - 02_enum_crscap.py: PASS
--------------------------------------------------------------------
RedirectionService - 03_RedirectionSAP_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: FAIL
ERROR - Unexpected rc code 4 and description One or more
parameter values passed to the method were invalid
InvokeMethod(CreateChildResourcePool): One or more parameter values passed
to the method were invalid
--------------------------------------------------------------------
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py:
PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
ERROR - Error in childpool creation
ERROR - (1, u'*** Provider
Virt_ResourcePoolConfigurationService(7207) exiting due to a SIGSEGV
signal ')
ERROR - Error in networkpool creation
InvokeMethod(CreateChildResourcePool): *** Provider
Virt_ResourcePoolConfigurationService(7207) exiting due to a SIGSEGV
signal
--------------------------------------------------------------------
ServiceAccessBySAP - 01_forward.py: PASS
--------------------------------------------------------------------
ServiceAccessBySAP - 02_reverse.py: PASS
--------------------------------------------------------------------
ServiceAffectsElement - 01_forward.py: PASS
--------------------------------------------------------------------
ServiceAffectsElement - 02_reverse.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: FAIL
ERROR - KVM_SettingsDefineCapabilities returned 8 ResourcePool
objects instead of 4
--------------------------------------------------------------------
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: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL
--------------------------------------------------------------------
VirtualSystemManagementService - 10_hv_version.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 11_define_memrasdunits.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 12_referenced_config.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 14_define_sys_disk.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 15_mod_system_settings.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 16_removeresource.py: XFAIL
ERROR - 0 RASD insts for domain/mouse:ps2
No such instance (no device domain/mouse:ps2)
Bug:<00014>
--------------------------------------------------------------------
VirtualSystemManagementService - 17_removeresource_neg.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
--------------------------------------------------------------------
VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 08_remote_restart_resume_migration.py:
SKIP
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 01_forward.py: PASS
--------------------------------------------------------------------
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
--------------------------------------------------------------------
15 years, 7 months
[PATCH] [TEST] #4 Update RPCS/04 with the latest updates of pool verification
by yunguol@cn.ibm.com
# HG changeset patch
# User Yun Guo Lian <yunguol(a)cn.ibm.com>
# Date 1242728480 25200
# Node ID 8de9a3fab292ea47563bc3c3617c7a8f9ea6753b
# Parent 6dc2d815e480237c91115cd0d86f6325503e33f7
[TEST] #4 Update RPCS/04 with the latest updates of pool verification
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com
diff -r 6dc2d815e480 -r 8de9a3fab292 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Tue May 19 03:21:20 2009 -0700
@@ -39,45 +39,71 @@
# OUT -- Error -- String -- Encoded error instance if the operation
# failed and did not return a job
#
-# REVISIT :
-# --------
-# As of now the CreateChildResourcePool() simply throws an Exception.
-# We must improve this tc once the service is implemented.
-#
-# -Date: 20.02.2008
-
+# Exception details before Revision 837
+# -----
+# Error code: CIM_ERR_NOT_SUPPORTED
+#
+# After revision 837, the service is implemented
+#
+# -Date: 20.02.2008
import sys
-import pywbem
-from XenKvmLib import rpcs_service
+import random
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
from XenKvmLib.const import do_main, platform_sup
from XenKvmLib.classes import get_typed_class
+from XenKvmLib.common_util import destroy_netpool
+from XenKvmLib.pool import create_netpool, verify_pool, undefine_netpool
-cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_mname = "CreateChildResourcePool"
+test_pool = "testpool"
@do_main(platform_sup)
def main():
options = main.options
- rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
- "ResourcePoolConfigurationService"))(options.ip)
- try:
- rpcs_conn.CreateChildResourcePool()
- except pywbem.CIMError, (err_no, desc):
- if err_no == cim_errno :
- logger.info("Got expected exception for '%s' service", cim_mname)
- logger.info("Errno is '%s' ", err_no)
- logger.info("Error string is '%s'", desc)
- return PASS
- else:
- logger.error("Unexpected rc code %s and description %s\n",
- err_no, desc)
+
+ np = get_typed_class(options.virt, 'NetworkPool')
+ np_id = "NetworkPool/%s" % test_pool
+
+ subnet = '192.168.0.'
+ ip_base = random.randint(1, 100)
+ addr = subnet+'%d' % ip_base
+ range_addr_start = subnet+'%d' % (ip_base + 1)
+ range_addr_end = subnet+'%d' %(ip_base + 10)
+ pool_attr = {
+ "Address" : addr,
+ "Netmask" : "255.255.255.0",
+ "IPRangeStart" : range_addr_start,
+ "IPRangeEnd" : range_addr_end
+ }
+ for item in range(0, 3):
+ status = create_netpool(options.ip, options.virt,
+ test_pool, pool_attr, mode_type=item)
+ if status != PASS:
+ logger.error("Error in networkpool creation")
return FAIL
-
- logger.error("The execution should not have reached here!!")
- return FAIL
+
+ status = verify_pool(options.ip, options.virt, np,
+ test_pool, pool_attr, mode_type=item)
+ if status != PASS:
+ logger.error("Error in networkpool verification")
+ destroy_netpool(options.ip, options.virt, test_pool)
+ undefine_netpool(options.ip, options.virt, test_pool)
+ return FAIL
+
+ status = destroy_netpool(options.ip, options.virt, test_pool)
+ if status != PASS:
+ logger.error("Unable to destroy networkpool %s", test_pool)
+ return FAIL
+
+ status = undefine_netpool(options.ip, options.virt, test_pool)
+ if status != PASS:
+ logger.error("Unable to undefine networkpool %s", test_pool)
+ return FAIL
+
+ status = PASS
+
+ return status
+
if __name__ == "__main__":
sys.exit(main())
-
diff -r 6dc2d815e480 -r 8de9a3fab292 suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Tue May 19 03:21:20 2009 -0700
@@ -144,7 +144,7 @@
return PASS
-def create_netpool(server, virt, test_pool, pool_attr_list):
+def create_netpool(server, virt, test_pool, pool_attr_list, mode_type=0):
status = PASS
rpcs = get_typed_class(virt, "ResourcePoolConfigurationService")
rpcs_conn = eval("rpcs_service." + rpcs)(server)
@@ -177,11 +177,14 @@
logger.error("We can not get NetPoolRASDs")
return FAIL
else:
- net_pool_rasds[0]['PoolID'] = "NetworkPool/%s" % test_pool
- for attr, val in pool_attr_list.iteritems():
- net_pool_rasds[0][attr] = val
-
- pool_settings = inst_to_mof(net_pool_rasds[0])
+ for i in range(0, len(net_pool_rasds)):
+ if net_pool_rasds[i]['ForwardMode'] == mode_type:
+ net_pool_rasds[i]['PoolID'] = "NetworkPool/%s" % test_pool
+ for attr, val in pool_attr_list.iteritems():
+ net_pool_rasds[i][attr] = val
+ break
+
+ pool_settings = inst_to_mof(net_pool_rasds[i])
try:
rpcs_conn.CreateChildResourcePool(ElementName=test_pool,
@@ -194,7 +197,7 @@
return status
-def verify_pool(server, virt, pooltype, poolname, pool_attr_list):
+def verify_pool(server, virt, pooltype, poolname, pool_attr_list, mode_type=0):
status = FAIL
pool_list = EnumInstances(server, pooltype)
if len(pool_list) < 1:
@@ -210,6 +213,15 @@
net_xml = NetXML(server, virt=virt, networkname=poolname,
is_new_net=False)
+
+ ret_mode = net_xml.xml_get_netpool_mode()
+ if mode_type == 1 and ret_mode != "nat":
+ logger.error("Got error when verify nat type")
+ return FAIL
+ elif mode_type == 2 and ret_mode != "route":
+ logger.error("Got error when verify route type")
+ return FAIL
+
ret_pool_attr_list = net_xml.xml_get_netpool_attr_list()
for i in range(0, len(ret_pool_attr_list)):
diff -r 6dc2d815e480 -r 8de9a3fab292 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue May 19 03:21:20 2009 -0700
@@ -271,16 +271,18 @@
npoolname = self.get_value_xpath('/network/name')
return npoolname
+ def xml_get_netpool_mode(self):
+ npoolmode = self.get_value_xpath('/network/forward/@mode')
+ return npoolmode
+
def xml_get_netpool_attr_list(self):
pool_attr_list = []
- npoolmode = self.get_value_xpath('/network/forward/@mode')
npooladdr = self.get_value_xpath('/network/ip/@address')
npoolmask = self.get_value_xpath('/network/ip/@netmask')
npoolstart = self.get_value_xpath('/network/ip/dhcp/range/@start')
npoolend = self.get_value_xpath('/network/ip/dhcp/range/@end')
- pool_attr_list.append(npoolmode)
pool_attr_list.append(npooladdr)
pool_attr_list.append(npoolmask)
pool_attr_list.append(npoolstart)
15 years, 7 months
[PATCH] [TEST]Add new tc to validate that the Disk child pool can be deleted through the providers
by yunguol@cn.ibm.com
# HG changeset patch
# User Yun Guo Lian <yunguol(a)cn.ibm.com>
# Date 1242720742 25200
# Node ID 0666f518db98e4406521f1a618318a98aead6974
# Parent 6dc2d815e480237c91115cd0d86f6325503e33f7
[TEST]Add new tc to validate that the Disk child pool can be deleted through the providers
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r 6dc2d815e480 -r 0666f518db98 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py Tue May 19 01:12:22 2009 -0700
@@ -0,0 +1,122 @@
+#!/usr/bin/python
+#
+# Copyright 2009 IBM Corp.
+#
+# Authors:
+# Guolian Yun <yunguol(a)cn.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
+#
+# This test case should test the DeleteResourcePool service
+# supplied by the RPCS provider.
+# The DeleteResourcePool is used to delete a resource pool.
+# DeleteResourcePool() details:
+# Input
+# -----
+# IN -- Pool -- CIM_ResourcePool REF -- The resource pool to delete
+#
+# Output
+# ------
+# OUT -- Job -- CIM_ConcreteJob REF -- Returned job if started
+# OUT -- Error-- String -- Encoded error instance if the operation
+# failed and did not return a job.
+#
+# Exception details before Revision 841
+# -----
+# Error code: CIM_ERR_NOT_SUPPORTED
+#
+# After revision 841, the service is implemented
+#
+# -Date: 19.05.2009
+
+import sys
+import pywbem
+from XenKvmLib import rpcs_service
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS
+from XenKvmLib.const import do_main, platform_sup, get_provider_version
+from XenKvmLib.enumclass import EnumInstances, EnumNames
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.pool import create_netpool, verify_pool
+
+cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
+cim_mname = "DeleteResourcePool"
+libvirt_cim_child_pool_rev = 841
+test_pool = "pool"
+
+@do_main(platform_sup)
+def main():
+ status = FAIL
+ options = main.options
+ rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
+ "ResourcePoolConfigurationService"))(options.ip)
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ if curr_cim_rev < libvirt_cim_child_pool_rev:
+ try:
+ rpcs_conn.DeleteResourcePool()
+ except pywbem.CIMError, (err_no, desc):
+ if err_no == cim_errno :
+ logger.info("Got expected exception for '%s' service", cim_mname)
+ logger.info("Errno is '%s' ", err_no)
+ logger.info("Error string is '%s'", desc)
+ return PASS
+ else:
+ logger.error("Unexpected rc code %s and description %s\n",
+ err_no, desc)
+ return FAIL
+ elif curr_cim_rev >= libvirt_cim_child_pool_rev:
+ pool_attr = {
+ "Path" : "/tmp"
+ }
+ dp = get_typed_class(options.virt, 'DiskPool')
+ dp_id = "DiskPool/%s" % test_pool
+
+ status = create_netpool(options.ip, options.virt, test_pool, pool_attr,
+ pool_type="DiskPool")
+ if status != PASS:
+ logger.error("Error in diskpool creation")
+ return FAIL
+
+ status = verify_pool(options.ip, options.virt, dp,
+ test_pool, pool_attr,
+ pool_type="DiskPool")
+ if status != PASS:
+ logger.error("Error in diskpool verification")
+ destroy_netpool(options.ip, options.virt, test_pool)
+ return FAIL
+
+ pool = EnumNames(options.ip, dp)
+ for i in range(0, len(pool)):
+ ret_pool = pool[i].keybindings['InstanceID']
+ if ret_pool == dp_id:
+ pool_settings = pool[i]
+ break
+ try:
+ rpcs_conn.DeleteResourcePool(Pool = pool_settings)
+ pool = EnumInstances(options.ip, dp)
+ for i in range(0, len(pool)):
+ ret_pool = pool[i].InstanceID
+ if ret_pool == dp_id:
+ raise Exception("Failed to delete %s" % test_pool)
+ status = PASS
+ except Exception, details:
+ logger.error(details)
+ return FAIL
+
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
diff -r 6dc2d815e480 -r 0666f518db98 suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Tue May 19 01:12:22 2009 -0700
@@ -32,7 +32,7 @@
from XenKvmLib import rpcs_service
import pywbem
from CimTest.CimExt import CIMClassMOF
-from XenKvmLib.vxml import NetXML
+from XenKvmLib.vxml import NetXML, PoolXML
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
cim_mname = "CreateChildResourcePool"
@@ -105,12 +105,12 @@
return volume
-def get_pool_rasds(server, virt):
+def get_pool_rasds(server, virt, pool_type="NetworkPool"):
net_pool_rasds = []
ac_cn = get_typed_class(virt, "AllocationCapabilities")
an_cn = get_typed_class(virt, "SettingsDefineCapabilities")
- key_list = {"InstanceID" : "NetworkPool/0" }
+ key_list = {"InstanceID" : "%s/0" % pool_type}
try:
inst = GetInstance(server, ac_cn, key_list)
@@ -144,7 +144,8 @@
return PASS
-def create_netpool(server, virt, test_pool, pool_attr_list):
+def create_netpool(server, virt, test_pool, pool_attr_list,
+ pool_type="NetworkPool"):
status = PASS
rpcs = get_typed_class(virt, "ResourcePoolConfigurationService")
rpcs_conn = eval("rpcs_service." + rpcs)(server)
@@ -162,22 +163,23 @@
logger.error("Unexpected rc code %s and description %s\n",
err_no, desc)
return FAIL
- elif curr_cim_rev >= libvirt_cim_child_pool_rev:
- n_list = net_list(server, virt)
- for _net_name in n_list:
- net_xml = NetXML(server=server, networkname=_net_name,
- virt=virt, is_new_net=False)
- pool_use_attr = net_xml.xml_get_netpool_attr_list()
- if pool_attr_list['Address'] in pool_use_attr:
- logger.error("IP address is in use by a different network")
- return FAIL
+ elif curr_cim_rev >= libvirt_cim_child_pool_rev:
+ if pool_type == "NetworkPool":
+ n_list = net_list(server, virt)
+ for _net_name in n_list:
+ net_xml = NetXML(server=server, networkname=_net_name,
+ virt=virt, is_new_net=False)
+ pool_use_attr = net_xml.xml_get_netpool_attr_list()
+ if pool_attr_list['Address'] in pool_use_attr:
+ logger.error("IP address is in use by a different network")
+ return FAIL
- net_pool_rasds = get_pool_rasds(server, virt)
+ net_pool_rasds = get_pool_rasds(server, virt, pool_type)
if len(net_pool_rasds) == 0:
- logger.error("We can not get NetPoolRASDs")
+ logger.error("We can not get PoolRASDs")
return FAIL
else:
- net_pool_rasds[0]['PoolID'] = "NetworkPool/%s" % test_pool
+ net_pool_rasds[0]['PoolID'] = "%s/%s" % (pool_type, test_pool)
for attr, val in pool_attr_list.iteritems():
net_pool_rasds[0][attr] = val
@@ -194,7 +196,8 @@
return status
-def verify_pool(server, virt, pooltype, poolname, pool_attr_list):
+def verify_pool(server, virt, pooltype, poolname, pool_attr_list,
+ pool_type="NetworkPool"):
status = FAIL
pool_list = EnumInstances(server, pooltype)
if len(pool_list) < 1:
@@ -202,16 +205,20 @@
len(pool_list))
return FAIL
- poolid = "NetworkPool/%s" % poolname
+ poolid = "%s/%s" % (pool_type, poolname)
for i in range(0, len(pool_list)):
ret_pool = pool_list[i].InstanceID
if ret_pool != poolid:
continue
- net_xml = NetXML(server, virt=virt, networkname=poolname,
- is_new_net=False)
- ret_pool_attr_list = net_xml.xml_get_netpool_attr_list()
-
+ if pool_type == "NetworkPool":
+ net_xml = NetXML(server, virt=virt, networkname=poolname,
+ is_new_net=False)
+ ret_pool_attr_list = net_xml.xml_get_netpool_attr_list()
+ elif pool_type == "DiskPool":
+ disk_xml = PoolXML(server ,virt=virt, poolname=poolname,
+ is_new_pool=False)
+ ret_pool_attr_list = disk_xml.xml_get_pool_attr_list()
for i in range(0, len(ret_pool_attr_list)):
if ret_pool_attr_list[i] not in pool_attr_list.itervalues():
logger.error("Got error when parsing %s", ret_pool_attr_list[i])
diff -r 6dc2d815e480 -r 0666f518db98 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue May 19 01:12:22 2009 -0700
@@ -291,7 +291,7 @@
class PoolXML(Virsh, XMLClass):
def __init__(self, server, poolname=const.default_pool_name,
- virt='xen'):
+ virt='xen', is_new_pool=True):
XMLClass.__init__(self)
if virt == 'XenFV':
@@ -300,6 +300,17 @@
self.pool_name = poolname
self.server = server
+ if is_new_pool is False:
+ cmd = "virsh pool-dumpxml %s" % self.pool_name
+ s, disk_xml = utils.run_remote(server, cmd)
+ if s != 0:
+ logger.error("Encounter error dump netxml")
+ return None
+ else:
+ self.xml_string = disk_xml
+ self.xdoc = minidom.parseString(self.xml_string)
+ return
+
pool = self.add_sub_node(self.xdoc, 'pool', type='dir')
self.add_sub_node(pool, 'name', self.pool_name)
target = self.add_sub_node(pool, 'target')
@@ -315,6 +326,12 @@
dpoolname = self.get_value_xpath('/pool/name')
return dpoolname
+ def xml_get_pool_attr_list(self):
+ pool_attr_list = []
+ poolpath = self.get_value_xpath('/pool/target/path')
+ pool_attr_list.append(poolpath)
+
+ return pool_attr_list
class VirtXML(Virsh, XMLClass):
"""Base class for all XML generation & operation"""
15 years, 7 months
[PATCH] [TEST] #3 Update RPCS/04 with the latest updatesof pool verification
by yunguol@cn.ibm.com
# HG changeset patch
# User Yun Guo Lian <yunguol(a)cn.ibm.com>
# Date 1242713086 25200
# Node ID 848683648c95f9367486db4d027b1d93683561dd
# Parent 6dc2d815e480237c91115cd0d86f6325503e33f7
[TEST] #3 Update RPCS/04 with the latest updatesof pool verification
Updates from 2 to 3:
Pull the NetPoolRASDs from get_pool_rasds() instead of setting the
properties appropriately and then create netpool for each types
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com
diff -r 6dc2d815e480 -r 848683648c95 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Mon May 18 23:04:46 2009 -0700
@@ -39,45 +39,70 @@
# OUT -- Error -- String -- Encoded error instance if the operation
# failed and did not return a job
#
-# REVISIT :
-# --------
-# As of now the CreateChildResourcePool() simply throws an Exception.
-# We must improve this tc once the service is implemented.
-#
-# -Date: 20.02.2008
-
+# Exception details before Revision 837
+# -----
+# Error code: CIM_ERR_NOT_SUPPORTED
+#
+# After revision 837, the service is implemented
+#
+# -Date: 20.02.2008
import sys
-import pywbem
-from XenKvmLib import rpcs_service
+import random
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
from XenKvmLib.const import do_main, platform_sup
from XenKvmLib.classes import get_typed_class
+from XenKvmLib.common_util import destroy_netpool
+from XenKvmLib.pool import create_netpool, verify_pool, undefine_netpool
-cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_mname = "CreateChildResourcePool"
+test_pool = "testpool"
@do_main(platform_sup)
def main():
options = main.options
- rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
- "ResourcePoolConfigurationService"))(options.ip)
- try:
- rpcs_conn.CreateChildResourcePool()
- except pywbem.CIMError, (err_no, desc):
- if err_no == cim_errno :
- logger.info("Got expected exception for '%s' service", cim_mname)
- logger.info("Errno is '%s' ", err_no)
- logger.info("Error string is '%s'", desc)
- return PASS
- else:
- logger.error("Unexpected rc code %s and description %s\n",
- err_no, desc)
- return FAIL
-
- logger.error("The execution should not have reached here!!")
- return FAIL
+
+ np = get_typed_class(options.virt, 'NetworkPool')
+ np_id = "NetworkPool/%s" % test_pool
+
+ subnet = '192.168.0.'
+ ip_base = random.randint(1, 100)
+ addr = subnet+'%d' % ip_base
+ range_addr_start = subnet+'%d' % (ip_base + 1)
+ range_addr_end = subnet+'%d' %(ip_base + 10)
+ pool_attr = {
+ "Address" : addr,
+ "Netmask" : "255.255.255.0",
+ "IPRangeStart" : range_addr_start,
+ "IPRangeEnd" : range_addr_end
+ }
+
+ status = create_netpool(options.ip, options.virt,
+ test_pool, pool_attr)
+ if status != PASS:
+ logger.error("Error in networkpool creation")
+ return FAIL
+
+ status = verify_pool(options.ip, options.virt, np,
+ test_pool, pool_attr)
+ if status != PASS:
+ logger.error("Error in networkpool verification")
+ destroy_netpool(options.ip, options.virt, test_pool)
+ undefine_netpool(options.ip, options.virt, test_pool)
+ return FAIL
+
+ status = destroy_netpool(options.ip, options.virt, test_pool)
+ if status != PASS:
+ logger.error("Unable to destroy networkpool %s", test_pool)
+ return FAIL
+
+ status = undefine_netpool(options.ip, options.virt, test_pool)
+ if status != PASS:
+ logger.error("Unable to undefine networkpool %s", test_pool)
+ return FAIL
+
+ status = PASS
+ return status
+
if __name__ == "__main__":
sys.exit(main())
-
diff -r 6dc2d815e480 -r 848683648c95 suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Mon May 18 23:04:46 2009 -0700
@@ -177,15 +177,16 @@
logger.error("We can not get NetPoolRASDs")
return FAIL
else:
- net_pool_rasds[0]['PoolID'] = "NetworkPool/%s" % test_pool
- for attr, val in pool_attr_list.iteritems():
- net_pool_rasds[0][attr] = val
-
- pool_settings = inst_to_mof(net_pool_rasds[0])
+ pool_settings = []
+ for i in range(0, len(net_pool_rasds)):
+ net_pool_rasds[i]['PoolID'] = "NetworkPool/%s" % test_pool
+ for attr, val in pool_attr_list.iteritems():
+ net_pool_rasds[i][attr] = val
+ pool_settings.append(inst_to_mof(net_pool_rasds[i]))
try:
rpcs_conn.CreateChildResourcePool(ElementName=test_pool,
- Settings=[pool_settings])
+ Settings=pool_settings)
except Exception, details:
logger.error("Error in childpool creation")
logger.error(details)
diff -r 6dc2d815e480 -r 848683648c95 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Sun May 17 23:34:58 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon May 18 23:04:46 2009 -0700
@@ -274,13 +274,11 @@
def xml_get_netpool_attr_list(self):
pool_attr_list = []
- npoolmode = self.get_value_xpath('/network/forward/@mode')
npooladdr = self.get_value_xpath('/network/ip/@address')
npoolmask = self.get_value_xpath('/network/ip/@netmask')
npoolstart = self.get_value_xpath('/network/ip/dhcp/range/@start')
npoolend = self.get_value_xpath('/network/ip/dhcp/range/@end')
- pool_attr_list.append(npoolmode)
pool_attr_list.append(npooladdr)
pool_attr_list.append(npoolmask)
pool_attr_list.append(npoolstart)
15 years, 7 months
[PATCH] [TEST] #2 Update RPCS/04 with the latest updatesof pool verification
by yunguol@cn.ibm.com
# HG changeset patch
# User Yun Guo Lian <yunguol(a)cn.ibm.com>
# Date 1242638914 25200
# Node ID eb0bbc2200a1b3c1649dcbe921f7e7103c2345a0
# Parent 43fb40db432952d38509a76e92e61d7d3d3702f7
[TEST] #2 Update RPCS/04 with the latest updatesof pool verification
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com
diff -r 43fb40db4329 -r eb0bbc2200a1 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Fri May 15 14:03:39 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Mon May 18 02:28:34 2009 -0700
@@ -39,45 +39,73 @@
# OUT -- Error -- String -- Encoded error instance if the operation
# failed and did not return a job
#
-# REVISIT :
-# --------
-# As of now the CreateChildResourcePool() simply throws an Exception.
-# We must improve this tc once the service is implemented.
-#
-# -Date: 20.02.2008
-
+# Exception details before Revision 837
+# -----
+# Error code: CIM_ERR_NOT_SUPPORTED
+#
+# After revision 837, the service is implemented
+#
+# -Date: 20.02.2008
import sys
-import pywbem
-from XenKvmLib import rpcs_service
+import random
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
from XenKvmLib.const import do_main, platform_sup
from XenKvmLib.classes import get_typed_class
+from XenKvmLib.common_util import destroy_netpool
+from XenKvmLib.pool import create_netpool, verify_pool, undefine_netpool
-cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_mname = "CreateChildResourcePool"
+test_pool = "testpool"
+test_mode = ["None", "nat", "route eth1"]
@do_main(platform_sup)
def main():
+ status = PASS
options = main.options
- rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
- "ResourcePoolConfigurationService"))(options.ip)
- try:
- rpcs_conn.CreateChildResourcePool()
- except pywbem.CIMError, (err_no, desc):
- if err_no == cim_errno :
- logger.info("Got expected exception for '%s' service", cim_mname)
- logger.info("Errno is '%s' ", err_no)
- logger.info("Error string is '%s'", desc)
- return PASS
- else:
- logger.error("Unexpected rc code %s and description %s\n",
- err_no, desc)
+
+ np = get_typed_class(options.virt, 'NetworkPool')
+ np_id = "NetworkPool/%s" % test_pool
+
+ subnet = '192.168.0.'
+ ip_base = random.randint(1, 100)
+ addr = subnet+'%d' % ip_base
+ range_addr_start = subnet+'%d' % (ip_base + 1)
+ range_addr_end = subnet+'%d' %(ip_base + 10)
+ pool_attr = {
+ "Address" : addr,
+ "Netmask" : "255.255.255.0",
+ "IPRangeStart" : range_addr_start,
+ "IPRangeEnd" : range_addr_end
+ }
+ for i in range(0, len(test_mode)):
+ pool_attr["ForwardMode"] = test_mode[i]
+
+ status = create_netpool(options.ip, options.virt,
+ test_pool, pool_attr)
+ if status != PASS:
+ logger.error("Error in networkpool creation")
return FAIL
-
- logger.error("The execution should not have reached here!!")
- return FAIL
+
+ status = verify_pool(options.ip, options.virt, np,
+ test_pool, pool_attr)
+ if status != PASS:
+ logger.error("Error in networkpool verification")
+ destroy_netpool(options.ip, options.virt, test_pool)
+ undefine_netpool(options.ip, options.virt, test_pool)
+ return FAIL
+
+ status = destroy_netpool(options.ip, options.virt, test_pool)
+ if status != PASS:
+ logger.error("Unable to destroy networkpool %s", test_pool)
+ return FAIL
+
+ status = undefine_netpool(options.ip, options.virt, test_pool)
+ if status != PASS:
+ logger.error("Unable to undefine networkpool %s", test_pool)
+ return FAIL
+
+ return status
+
if __name__ == "__main__":
sys.exit(main())
-
15 years, 7 months
[PATCH] [TEST] Fixing SAE/01_forward.py SAE tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1242628498 25200
# Node ID 6dc2d815e480237c91115cd0d86f6325503e33f7
# Parent 43fb40db432952d38509a76e92e61d7d3d3702f7
[TEST] Fixing SAE/01_forward.py SAE tc.
Tested with KVM on F10 with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 43fb40db4329 -r 6dc2d815e480 suites/libvirt-cim/cimtest/ServiceAffectsElement/01_forward.py
--- a/suites/libvirt-cim/cimtest/ServiceAffectsElement/01_forward.py Fri May 15 14:03:39 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ServiceAffectsElement/01_forward.py Sun May 17 23:34:58 2009 -0700
@@ -115,7 +115,7 @@
assoc_insts = {}
try:
assoc_insts, status = get_dom_records(an, assoc_info, assoc_insts)
- if status != PASS or len(assoc_insts) != 3:
+ if status != PASS or len(assoc_insts) < 1 :
raise Exception("Failed to get insts for domain %s" % test_dom)
in_list, status = init_list_for_compare(server, virt)
@@ -124,7 +124,7 @@
in_list_keys = Set(in_list.keys())
assoc_list_keys = Set(assoc_insts.keys())
- if len(in_list_keys & assoc_list_keys) != 3:
+ if len(in_list_keys & assoc_list_keys) < 1 :
raise Exception("Mistmatching Class Names, expected %s, got %s" \
% (in_list_keys, assoc_list_keys))
15 years, 7 months
[PATCH] [TEST] #2 Add general functions for pool verification
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1242287001 25200
# Node ID fe5b8e3ff97aa7892c050b2642838ca2d0840a5e
# Parent 9391439d65e7ec6b88f34923d97f969c6114a237
[TEST] #2 Add general functions for pool verification
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r 9391439d65e7 -r fe5b8e3ff97a suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Wed May 13 07:28:33 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Thu May 14 00:43:21 2009 -0700
@@ -21,15 +21,23 @@
#
import sys
-from CimTest.Globals import logger
+from CimTest.Globals import logger, CIM_NS
from CimTest.ReturnCodes import PASS, FAIL
-from XenKvmLib.classes import get_typed_class
+from XenKvmLib.classes import get_typed_class, inst_to_mof
from XenKvmLib.const import get_provider_version, default_pool_name
-from XenKvmLib.enumclass import EnumInstances
+from XenKvmLib.enumclass import EnumInstances, GetInstance
+from XenKvmLib.assoc import Associators
from VirtLib.utils import run_remote
-from XenKvmLib.xm_virt_util import virt2uri
+from XenKvmLib.xm_virt_util import virt2uri, net_list
+from XenKvmLib import rpcs_service
+import pywbem
+from CimTest.CimExt import CIMClassMOF
+from XenKvmLib.vxml import NetXML
+cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
+cim_mname = "CreateChildResourcePool"
input_graphics_pool_rev = 757
+libvirt_cim_child_pool_rev = 837
def pool_cn_to_rasd_cn(pool_cn, virt):
if pool_cn.find('ProcessorPool') >= 0:
@@ -97,3 +105,118 @@
return volume
+def get_pool_rasds(server, virt):
+ net_pool_rasds = []
+
+ ac_cn = get_typed_class(virt, "AllocationCapabilities")
+ an_cn = get_typed_class(virt, "SettingsDefineCapabilities")
+ key_list = {"InstanceID" : "NetworkPool/0" }
+
+ try:
+ inst = GetInstance(server, ac_cn, key_list)
+ rasd = Associators(server, an_cn, ac_cn, InstanceID=inst.InstanceID)
+ except Exception, detail:
+ logger.error("Exception: %s", detail)
+ return None
+
+ for item in rasd:
+ if item['InstanceID'] == "Default":
+ net_pool_rasds.append(item)
+
+ return net_pool_rasds
+
+def net_undefine(network, server, virt="Xen"):
+ """Function undefine a given virtual network"""
+
+ cmd = "virsh -c %s net-undefine %s" % (virt2uri(virt), network)
+ ret, out = run_remote(server, cmd)
+
+ return ret
+
+def undefine_netpool(server, virt, net_name):
+ if net_name == None:
+ return FAIL
+
+ ret = net_undefine(net_name, server, virt)
+ if ret != 0:
+ logger.error("Failed to undefine Virtual Network '%s'", net_name)
+ return FAIL
+
+ return PASS
+
+def create_netpool(server, virt, test_pool, pool_attr_list):
+ status = PASS
+ rpcs = get_typed_class(virt, "ResourcePoolConfigurationService")
+ rpcs_conn = eval("rpcs_service." + rpcs)(server)
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if curr_cim_rev < libvirt_cim_child_pool_rev:
+ try:
+ rpcs_conn.CreateChildResourcePool()
+ except pywbem.CIMError, (err_no, desc):
+ if err_no == cim_errno :
+ logger.info("Got expected exception for '%s'service", cim_mname)
+ logger.info("Errno is '%s' ", err_no)
+ logger.info("Error string is '%s'", desc)
+ return PASS
+ else:
+ logger.error("Unexpected rc code %s and description %s\n",
+ err_no, desc)
+ return FAIL
+ elif curr_cim_rev >= libvirt_cim_child_pool_rev:
+ n_list = net_list(server, virt)
+ for _net_name in n_list:
+ net_xml = NetXML(server=server, networkname=_net_name,
+ virt=virt, is_new_net=False)
+ pool_use_attr = net_xml.xml_get_netpool_attr_list()
+ if pool_attr_list['Address'] in pool_use_attr:
+ logger.error("IP address is in use by a different network")
+ return FAIL
+
+ net_pool_rasds = get_pool_rasds(server, virt)
+ if len(net_pool_rasds) == 0:
+ logger.error("We can not get NetPoolRASDs")
+ return FAIL
+ else:
+ net_pool_rasds[0]['PoolID'] = "NetworkPool/%s" % test_pool
+ for attr, val in pool_attr_list.iteritems():
+ net_pool_rasds[0][attr] = val
+
+ pool_settings = inst_to_mof(net_pool_rasds[0])
+
+ try:
+ rpcs_conn.CreateChildResourcePool(ElementName=test_pool,
+ Settings=[pool_settings])
+ except Exception, details:
+ logger.error("Error in childpool creation")
+ logger.error(details)
+ return FAIL
+
+ return status
+
+
+def verify_pool(server, virt, pooltype, poolname, pool_attr_list):
+ status = FAIL
+ pool_list = EnumInstances(server, pooltype)
+ if len(pool_list) < 1:
+ logger.error("Return %i instances, expected at least one instance",
+ len(pool_list))
+ return FAIL
+
+ poolid = "NetworkPool/%s" % poolname
+ for i in range(0, len(pool_list)):
+ ret_pool = pool_list[i].InstanceID
+ if ret_pool != poolid:
+ continue
+
+ net_xml = NetXML(server, virt=virt, networkname=poolname,
+ is_new_net=False)
+ ret_pool_attr_list = net_xml.xml_get_netpool_attr_list()
+
+ for i in range(0, len(ret_pool_attr_list)):
+ if ret_pool_attr_list[i] not in pool_attr_list.itervalues():
+ logger.error("Got error when parsing %s", ret_pool_attr_list[i])
+ return FAIL
+
+ status = PASS
+
+ return status
diff -r 9391439d65e7 -r fe5b8e3ff97a suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed May 13 07:28:33 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu May 14 00:43:21 2009 -0700
@@ -197,7 +197,8 @@
def __init__(self, server, bridgename=const.default_bridge_name,
networkname=const.default_network_name,
- virt='xen'):
+ virt='xen',
+ is_new_net=True):
def get_valid_bridge_name(server):
bridge_list = live.available_bridges(server)
@@ -222,6 +223,17 @@
self.net_name = networkname
self.server = server
+ if is_new_net is False:
+ cmd = "virsh net-dumpxml %s" % self.net_name
+ s, net_xml = utils.run_remote(server, cmd)
+ if s != 0:
+ logger.error("Encounter error dump netxml")
+ return None
+ else:
+ self.xml_string = net_xml
+ self.xdoc = minidom.parseString(self.xml_string)
+ return
+
network = self.add_sub_node(self.xdoc, 'network')
self.add_sub_node(network, 'name', self.net_name)
self.add_sub_node(network, 'uuid', set_uuid())
@@ -259,6 +271,22 @@
npoolname = self.get_value_xpath('/network/name')
return npoolname
+ def xml_get_netpool_attr_list(self):
+ pool_attr_list = []
+
+ npoolmode = self.get_value_xpath('/network/forward/@mode')
+ npooladdr = self.get_value_xpath('/network/ip/@address')
+ npoolmask = self.get_value_xpath('/network/ip/@netmask')
+ npoolstart = self.get_value_xpath('/network/ip/dhcp/range/@start')
+ npoolend = self.get_value_xpath('/network/ip/dhcp/range/@end')
+
+ pool_attr_list.append(npoolmode)
+ pool_attr_list.append(npooladdr)
+ pool_attr_list.append(npoolmask)
+ pool_attr_list.append(npoolstart)
+ pool_attr_list.append(npoolend)
+
+ return pool_attr_list
class PoolXML(Virsh, XMLClass):
15 years, 7 months
[PATCH] Set the InitPath for LXC guests
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1242279945 25200
# Node ID 1a625ee4280f4f55fbed04c2eeb973e3af3e5816
# Parent 032d34765a83b2f6784fd33e488b8829f3391603
Set the InitPath for LXC guests
This was missed when InitPath support for LXC guests was added.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 032d34765a83 -r 1a625ee4280f src/Virt_VSSD.c
--- a/src/Virt_VSSD.c Wed May 13 07:40:47 2009 -0700
+++ b/src/Virt_VSSD.c Wed May 13 22:45:45 2009 -0700
@@ -88,6 +88,16 @@
CMPI_chars);
}
+static void _set_lxc_prop(struct domain *dominfo,
+ CMPIInstance *inst)
+{
+ if (dominfo->os_info.lxc.init != NULL)
+ CMSetProperty(inst,
+ "InitPath",
+ (CMPIValue *)dominfo->os_info.lxc.init,
+ CMPI_chars);
+}
+
static int instance_from_dom(virDomainPtr dom,
CMPIInstance *inst)
{
@@ -151,6 +161,8 @@
_set_fv_prop(dominfo, inst);
else if (dominfo->type == DOMAIN_XENPV)
_set_pv_prop(dominfo, inst);
+ else if (dominfo->type == DOMAIN_LXC)
+ _set_lxc_prop(dominfo, inst);
else
CU_DEBUG("Unknown domain type %i for creating VSSD",
dominfo->type);
15 years, 7 months
[PATCH] Allow user to specify UUID to use when guest is created
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1241805181 25200
# Node ID 9a16c7a7963cebddd145212e57ccc9defa5e0a0c
# Parent e08c78615c3ec653c2979b4619b15d48a1c56d48
Allow user to specify UUID to use when guest is created
Also expose UUID in VSSD instances.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r e08c78615c3e -r 9a16c7a7963c schema/ComputerSystem.mof
--- a/schema/ComputerSystem.mof Mon May 11 10:23:34 2009 -0700
+++ b/schema/ComputerSystem.mof Fri May 08 10:53:01 2009 -0700
@@ -7,7 +7,6 @@
]
class Xen_ComputerSystem : CIM_ComputerSystem
{
-
[Description("UUID assigned to this DomU.")]
string UUID;
diff -r e08c78615c3e -r 9a16c7a7963c schema/Virt_VSSD.mof
--- a/schema/Virt_VSSD.mof Mon May 11 10:23:34 2009 -0700
+++ b/schema/Virt_VSSD.mof Fri May 08 10:53:01 2009 -0700
@@ -12,4 +12,7 @@
Values { "Turn Off", "Save state", "DMTF Reserved" }]
uint16 AutomaticShutdownAction;
+ [Description("UUID assigned to this DomU.")]
+ string UUID;
+
};
diff -r e08c78615c3e -r 9a16c7a7963c src/Virt_VSSD.c
--- a/src/Virt_VSSD.c Mon May 11 10:23:34 2009 -0700
+++ b/src/Virt_VSSD.c Fri May 08 10:53:01 2009 -0700
@@ -113,6 +113,9 @@
CMSetProperty(inst, "VirtualSystemType",
(CMPIValue *)pfx, CMPI_chars);
+ CMSetProperty(inst, "UUID",
+ (CMPIValue *)dominfo->uuid, CMPI_chars);
+
CMSetProperty(inst, "Caption",
(CMPIValue *)"Virtual System", CMPI_chars);
diff -r e08c78615c3e -r 9a16c7a7963c src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon May 11 10:23:34 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri May 08 10:53:01 2009 -0700
@@ -337,6 +337,12 @@
free(domain->name);
domain->name = strdup(val);
+ ret = cu_get_str_prop(inst, "UUID", &val);
+ if (ret == CMPI_RC_OK) {
+ free(domain->uuid);
+ domain->uuid = strdup(val);
+ }
+
ret = cu_get_u16_prop(inst, "AutomaticShutdownAction", &tmp);
if (ret != CMPI_RC_OK)
tmp = 0;
15 years, 7 months