[PATCH] [TEST] #4 Update RPCS/07_DeleteResourcePool.py validate that the Network pool can be deleted through the providers
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1240819808 25200
# Node ID fc3416aaa19e164920af1d7b264175706d68222b
# Parent e8dc06eefada41252ba8d27b08fcef8ef6604251
[TEST] #4 Update RPCS/07_DeleteResourcePool.py validate that the Network pool can be deleted through the providers
Updates from 3 to 4:
1) Move general net function to common.py
2) move the CIM_NS import stmt along with the logger
Updates from 2 to 3:
1) Use CIM_NS from const.py instead of hardcoding
2) Check if the IP is already used on the system before setting
3) Rewrite try, except... blocks
Updates from 1 to 2:
Test all types of networkpool including routed network, nat based network and isolated network
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r e8dc06eefada -r fc3416aaa19e suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Tue Apr 21 17:08:06 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Mon Apr 27 01:10:08 2009 -0700
@@ -39,45 +39,104 @@
# 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
-from CimTest.Globals import logger
+from CimTest.Globals import logger, CIM_NS
from CimTest.ReturnCodes import FAIL, PASS
-from XenKvmLib.const import do_main, platform_sup
+from XenKvmLib.const import do_main, platform_sup, get_provider_version
from XenKvmLib.classes import get_typed_class
+from pywbem.cim_obj import CIMInstanceName, CIMInstance
+from XenKvmLib.common_util import destroy_netpool, undefine_netpool, \
+ verify_pool
+from XenKvmLib.xm_virt_util import net_list
+from VirtLib.utils import run_remote
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
cim_mname = "CreateChildResourcePool"
+libvirt_cim_child_pool_rev = 837
+test_pool = ["routedpool", "natpool", "isolatedpool"]
@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
+
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ 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:
+ nprasd = get_typed_class(options.virt,
+ 'NetPoolResourceAllocationSettingData')
+ addr = "192.168.0.30"
+ n_list = net_list(options.ip, options.virt)
+ for _net_name in n_list:
+ cmd = "virsh net-dumpxml %s | awk '/ip address/ {print}' | \
+ cut -d ' ' -f 4 | sed 's/address=//'" % _net_name
+ s, in_use_addr = run_remote(options.ip, cmd)
+ in_use_addr = in_use_addr.strip("'")
+ if in_use_addr == addr:
+ logger.error("IP address is in use by a different network")
+ return FAIL
+ np_prop = {
+ "Address" : addr,
+ "Netmask" : "255.255.255.0",
+ "IPRangeStart" : "192.168.0.31",
+ "IPRangeEnd" : "192.168.0.57",
+ }
+ for i in range(0, len(test_pool)):
+ np_id = 'NetworkPool/%s' % test_pool[i]
+ iname = CIMInstanceName(nprasd,
+ namespace = CIM_NS,
+ keybindings = {'InstanceID':np_id})
+ if test_pool[i] == "routedpool":
+ np_prop["ForwardMode"] = "route eth1"
+ elif test_pool[i] == "natpool":
+ np_prop["ForwardMode"] = "nat"
+
+ nrasd = CIMInstance(nprasd, path = iname, properties = np_prop)
+ try:
+ rpcs_conn.CreateChildResourcePool(ElementName=test_pool[i],
+ Settings=[nrasd.tomof()])
+ np = get_typed_class(options.virt, 'NetworkPool')
+ status = verify_pool(options.ip, np, np_id)
+ if status != PASS:
+ raise Exception("Error in networkpool verification")
+ status = destroy_netpool(options.ip, options.virt, test_pool[i])
+ if status != PASS:
+ raise Exception("Unable to destroy networkpool %s"
+ % test_pool[i])
+ status = undefine_netpool(options.ip, options.virt, test_pool[i])
+ if status != PASS:
+ raise Exception("Unable to undefine networkpool %s"
+ % test_pool[i])
+ except Exception, details:
+ logger.error("Error in networkpool %s creation and verification"
+ " through provider", np_id)
+ logger.error(details)
+ return FAIL
+
+ return status
+
if __name__ == "__main__":
sys.exit(main())
-
diff -r e8dc06eefada -r fc3416aaa19e suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Apr 21 17:08:06 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Apr 27 01:10:08 2009 -0700
@@ -26,7 +26,8 @@
from time import sleep
from distutils.file_util import move_file
from XenKvmLib.test_xml import *
-from XenKvmLib.test_doms import *
+from XenKvmLib.test_doms import *
+from XenKvmLib.enumclass import EnumInstances
from XenKvmLib import vsms
from CimTest import Globals
from XenKvmLib import enumclass
@@ -385,7 +386,29 @@
logger.error("Failed to destroy Virtual Network '%s'", net_name)
return FAIL
- return PASS
+ return PASS
+
+def net_undefine(network, server, virt="Xen"):
+ """Function undefine a given virtual network"""
+
+ cmd = "virsh -c %s net-undefine %s" % (virt2uri(virt), network)
+ print cmd
+ ret, out = utils.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 libvirt_cached_data_poll(ip, virt, dom_name):
cs = None
@@ -435,3 +458,20 @@
return guest_name, devid, PASS
+def verify_pool(server, networkpool, poolname):
+ status = FAIL
+ pool_list = EnumInstances(server, networkpool)
+ if len(pool_list) < 1:
+ logger.error("Return %i instances, expected at least one instance",
+ len(pool_list))
+ return FAIL
+
+ for i in range(0, len(pool_list)):
+ ret_pool = pool_list[i].InstanceID
+ if ret_pool == poolname:
+ status = PASS
+ break
+ elif ret_pool != poolname and i == len(pool_list)-1:
+ logger.error("Can not find expected pool")
+
+ return status
15 years, 7 months
[PATCH] [TEST] #3Update RPCS/04 to validate that the Network child pool can be created through the providers
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1240466305 25200
# Node ID 6789fc642c76198f983ed771f4a00237ed6daeff
# Parent e8dc06eefada41252ba8d27b08fcef8ef6604251
[TEST] #3Update RPCS/04 to validate that the Network child pool can be created through the providers
Updates from 2 to 3:
1) Use CIM_NS from const.py instead of hardcoding
2) Check if the IP is already used on the system before setting
3) Rewrite try, except... blocks
Updates from 1 to 2:
Test all types of networkpool including routed network, nat based network and isolated network
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r e8dc06eefada -r 6789fc642c76 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Tue Apr 21 17:08:06 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Wed Apr 22 22:58:25 2009 -0700
@@ -39,45 +39,123 @@
# 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
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
-from XenKvmLib.const import do_main, platform_sup
+from CimTest.Globals import CIM_NS
+from XenKvmLib.const import do_main, platform_sup, get_provider_version
from XenKvmLib.classes import get_typed_class
+from pywbem.cim_obj import CIMInstanceName, CIMInstance
+from XenKvmLib.enumclass import EnumInstances
+from XenKvmLib.common_util import destroy_netpool, undefine_netpool
+from XenKvmLib.xm_virt_util import net_list
+from VirtLib.utils import run_remote
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
cim_mname = "CreateChildResourcePool"
+libvirt_cim_child_pool_rev = 837
+test_pool = ["routedpool", "natpool", "isolatedpool"]
+
+def verify_pool(pool_list, poolname):
+ status = FAIL
+ if len(pool_list) < 1:
+ logger.error("Return %i instances, expected at least one instance",
+ len(pool_list))
+ return FAIL
+
+ for i in range(0, len(pool_list)):
+ ret_pool = pool_list[i].InstanceID
+ if ret_pool == poolname:
+ status = PASS
+ break
+ elif ret_pool != poolname and i == len(pool_list)-1:
+ logger.error("Can not find expected pool")
+
+ return status
@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
+
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ 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:
+ nprasd = get_typed_class(options.virt,
+ 'NetPoolResourceAllocationSettingData')
+ addr = "192.168.0.30"
+ n_list = net_list(options.ip, options.virt)
+ for _net_name in n_list:
+ cmd = "virsh net-dumpxml %s | awk '/ip address/ {print}' | \
+ cut -d ' ' -f 4 | sed 's/address=//'" % _net_name
+ s, in_use_addr = run_remote(options.ip, cmd)
+ in_use_addr = in_use_addr.strip("'")
+ if in_use_addr == addr:
+ logger.error("IP address is in use by a different network")
+ return FAIL
+ np_prop = {
+ "Address" : addr,
+ "Netmask" : "255.255.255.0",
+ "IPRangeStart" : "192.168.0.31",
+ "IPRangeEnd" : "192.168.0.57",
+ }
+ for i in range(0, len(test_pool)):
+ np_id = 'NetworkPool/%s' % test_pool[i]
+ iname = CIMInstanceName(nprasd,
+ namespace = CIM_NS,
+ keybindings = {'InstanceID':np_id})
+ if test_pool[i] == "routedpool":
+ np_prop["ForwardMode"] = "route eth1"
+ elif test_pool[i] == "natpool":
+ np_prop["ForwardMode"] = "nat"
+
+ nrasd = CIMInstance(nprasd, path = iname, properties = np_prop)
+ try:
+ rpcs_conn.CreateChildResourcePool(ElementName=test_pool[i],
+ Settings=[nrasd.tomof()])
+ np = get_typed_class(options.virt, 'NetworkPool')
+ netpool = EnumInstances(options.ip, np)
+ status = verify_pool(netpool, np_id)
+ if status != PASS:
+ raise Exception("Error in networkpool verification")
+ status = destroy_netpool(options.ip, options.virt, test_pool[i])
+ if status != PASS:
+ raise Exception("Unable to destroy networkpool %s"
+ % test_pool[i])
+ status = undefine_netpool(options.ip, options.virt, test_pool[i])
+ if status != PASS:
+ raise Exception("Unable to undefine networkpool %s"
+ % test_pool[i])
+ except Exception, details:
+ logger.error("Invoke CreateChildResourcePool() error when "
+ "create %s", np_id)
+ logger.error(details)
+ return FAIL
+
+ return status
+
if __name__ == "__main__":
sys.exit(main())
-
diff -r e8dc06eefada -r 6789fc642c76 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Apr 21 17:08:06 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Apr 22 22:58:25 2009 -0700
@@ -36,7 +36,8 @@
CIM_ERROR_GETINSTANCE
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.xm_virt_util import diskpool_list, virsh_version, net_list,\
- domain_list, virt2uri, net_destroy
+ domain_list, virt2uri, net_destroy,\
+ net_undefine
from XenKvmLib.vxml import PoolXML, NetXML
from VirtLib import utils
from XenKvmLib.const import default_pool_name, default_network_name
@@ -387,6 +388,17 @@
return PASS
+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 libvirt_cached_data_poll(ip, virt, dom_name):
cs = None
diff -r e8dc06eefada -r 6789fc642c76 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Apr 21 17:08:06 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Wed Apr 22 22:58:25 2009 -0700
@@ -191,6 +191,15 @@
ret, out = utils.run_remote(server, cmd)
return ret
+
+def net_undefine(network, server, virt="Xen"):
+ """Function undefine a given virtual network"""
+
+ cmd = "virsh -c %s net-undefine %s" % (virt2uri(virt), network)
+ print cmd
+ ret, out = utils.run_remote(server, cmd)
+
+ return ret
def network_by_bridge(bridge, server, virt="Xen"):
"""Function returns virtual network for a given bridge"""
15 years, 7 months
On SLES 11 with SFCB Xen_HostSystem returns no instances
by Medlyn, Dayne (VSL - Ft Collins)
In the SLES 11 distribution Novell is distributing libvirt-cim-0.5.2-8.46 and registering it with the SFCB CIMOM. Does anyone know why the enumeration of Xen_HostSystem returns no instances? I could not find any mention of this on the mailing list.
Thanks for your help.
Dayne Medlyn
15 years, 7 months
Test Run Summary (Apr 22 2009): KVM on Fedora release 10 (Cambridge) with Pegasus
by Deepti B Kalakeri
=================================================
Test Run Summary (Apr 22 2009): KVM on Fedora release 10 (Cambridge) with Pegasus
=================================================
Distro: Fedora release 10 (Cambridge)
Kernel: 2.6.27.15-170.2.24.fc10.x86_64
libvirt: 0.5.1
Hypervisor: QEMU 0.9.1
CIMOM: Pegasus 2.7.1
Libvirt-cim revision: 812
Libvirt-cim changeset: bad1a43ac1b0
Cimtest revision: 674
Cimtest changeset: e8dc06eefada
=================================================
FAIL : 0
XFAIL : 3
SKIP : 4
PASS : 144
-----------------
Total : 151
=================================================
XFAIL Test Summary:
ComputerSystem - 32_start_reboot.py: XFAIL
ComputerSystem - 33_suspend_reboot.py: XFAIL
VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL
=================================================
SKIP Test Summary:
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
=================================================
Full report:
--------------------------------------------------------------------
AllocationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 01_enum.py: PASS
--------------------------------------------------------------------
ComputerSystem - 02_nosystems.py: PASS
--------------------------------------------------------------------
ComputerSystem - 03_defineVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 04_defineStartVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 05_activate_defined_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 06_paused_active_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 22_define_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 23_pause_pause.py: PASS
--------------------------------------------------------------------
ComputerSystem - 27_define_pause_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: XFAIL
ERROR - Got CIM error CIM_ERR_FAILED: 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): CIM_ERR_FAILED: 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 CIM_ERR_NOT_SUPPORTED: State not supported with return code 7
ERROR - Exception: Unable Suspend dom 'test_domain'
InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: 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: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 04_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 05_hostsystem_cap.py: PASS
--------------------------------------------------------------------
ElementConforms - 01_forward.py: PASS
--------------------------------------------------------------------
ElementConforms - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementConforms - 03_ectp_fwd_errs.py: PASS
--------------------------------------------------------------------
ElementConforms - 04_ectp_rev_errs.py: PASS
--------------------------------------------------------------------
ElementSettingData - 01_forward.py: PASS
--------------------------------------------------------------------
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 01_enum.py: PASS
--------------------------------------------------------------------
HostSystem - 02_hostsystem_to_rasd.py: PASS
--------------------------------------------------------------------
HostSystem - 03_hs_to_settdefcap.py: PASS
--------------------------------------------------------------------
HostSystem - 04_hs_to_EAPF.py: 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: PASS
--------------------------------------------------------------------
LogicalDisk - 03_ld_gi_errs.py: PASS
--------------------------------------------------------------------
Memory - 01_memory.py: PASS
--------------------------------------------------------------------
Memory - 02_defgetmem.py: PASS
--------------------------------------------------------------------
Memory - 03_mem_gi_errs.py: PASS
--------------------------------------------------------------------
NetworkPort - 01_netport.py: PASS
--------------------------------------------------------------------
NetworkPort - 02_np_gi_errors.py: PASS
--------------------------------------------------------------------
NetworkPort - 03_user_netport.py: PASS
--------------------------------------------------------------------
Processor - 01_processor.py: PASS
--------------------------------------------------------------------
Processor - 02_definesys_get_procs.py: PASS
--------------------------------------------------------------------
Processor - 03_proc_gi_errs.py: PASS
--------------------------------------------------------------------
Profile - 01_enum.py: PASS
--------------------------------------------------------------------
Profile - 02_profile_to_elec.py: 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: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS
--------------------------------------------------------------------
ServiceAccessBySAP - 01_forward.py: PASS
--------------------------------------------------------------------
ServiceAccessBySAP - 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: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS
--------------------------------------------------------------------
SystemDevice - 01_forward.py: PASS
--------------------------------------------------------------------
SystemDevice - 02_reverse.py: PASS
--------------------------------------------------------------------
SystemDevice - 03_fwderrs.py: PASS
--------------------------------------------------------------------
VSSD - 01_enum.py: PASS
--------------------------------------------------------------------
VSSD - 02_bootldr.py: SKIP
--------------------------------------------------------------------
VSSD - 03_vssd_gi_errs.py: PASS
--------------------------------------------------------------------
VSSD - 04_vssd_to_rasd.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 01_definesystem_name.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 02_destroysystem.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 06_addresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 07_addresource_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 08_modifyresource.py: 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: PASS
--------------------------------------------------------------------
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: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 07_remote_offline_migration.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: PASS
--------------------------------------------------------------------
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
--------------------------------------------------------------------
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik(a)linux.vnet.ibm.com
15 years, 7 months
[PATCH] [TEST] Add new tc to validate that the Disk child pool can be created through the providers
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1240479451 25200
# Node ID e1be3bd47b8005fad25dcfd80672870009d5c111
# Parent e8dc06eefada41252ba8d27b08fcef8ef6604251
[TEST] Add new tc to validate that the Disk child pool can be created through the providers
Tested for KVM with current sources
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r e8dc06eefada -r e1be3bd47b80 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateChildResourcePool_Disk.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateChildResourcePool_Disk.py Thu Apr 23 02:37:31 2009 -0700
@@ -0,0 +1,144 @@
+#!/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 CreateChildResourcePool service
+# supplied by the RPCS provider.
+# Input
+# -----
+# IN -- ElementName -- String -- The desired name of the resource pool
+# IN -- Settings -- String -- A string representation of a
+# CIM_ResourceAllocationSettingData
+# instance that represents the allocation
+# assigned to this child pool
+# IN -- ParentPool -- CIM_ResourcePool REF -- The parent pool from which
+# to create this pool
+#
+# Output
+# ------
+# OUT -- Pool -- CIM_ResourcePool REF -- The resulting resource pool
+# 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 837
+# -----
+# Error code: CIM_ERR_NOT_SUPPORTED
+#
+# After revision 837, the service is implemented
+#
+# -Date: 23.04.2009
+
+import sys
+import pywbem
+from XenKvmLib import rpcs_service
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS
+from CimTest.Globals import CIM_NS
+from XenKvmLib.const import do_main, platform_sup, get_provider_version
+from XenKvmLib.classes import get_typed_class
+from pywbem.cim_obj import CIMInstanceName, CIMInstance
+from XenKvmLib.enumclass import EnumInstances
+from XenKvmLib.xm_virt_util import diskpool_destroy, diskpool_undefine
+from pywbem.cim_types import Uint16
+
+cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
+cim_mname = "CreateChildResourcePool"
+libvirt_cim_child_pool_rev = 837
+test_pool = ["dir_pool"]
+
+def verify_pool(pool_list, poolname):
+ status = FAIL
+ if len(pool_list) < 1:
+ logger.error("Return %i instances, expected at least one instance",
+ len(pool_list))
+ return FAIL
+
+ for i in range(0, len(pool_list)):
+ ret_pool = pool_list[i].InstanceID
+ if ret_pool == poolname:
+ status = PASS
+ break
+ elif ret_pool != poolname and i == len(pool_list)-1:
+ logger.error("Can not find expected pool")
+
+ return status
+
+@do_main(platform_sup)
+def main():
+ 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.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:
+ dprasd = get_typed_class(options.virt,
+ 'DiskPoolResourceAllocationSettingData')
+ dp_prop = {"Path" : "/tmp"}
+
+ for i in range(0, len(test_pool)):
+ dp_id = 'DiskPool/%s' % test_pool[i]
+ iname = CIMInstanceName(dprasd,
+ namespace = CIM_NS,
+ keybindings = {'InstanceID':dp_id})
+ if test_pool[i] == "dir_pool":
+ dp_prop["Type"] = Uint16(1)
+
+ drasd = CIMInstance(dprasd, path = iname, properties = dp_prop)
+ try:
+ rpcs_conn.CreateChildResourcePool(ElementName=test_pool[i],
+ Settings=[drasd.tomof()])
+ dp = get_typed_class(options.virt, 'DiskPool')
+ diskpool = EnumInstances(options.ip, dp)
+ status = verify_pool(diskpool, dp_id)
+ if status != PASS:
+ raise Exception("Error in diskpool verification")
+ status = diskpool_destroy(test_pool[i], options.ip, options.virt)
+ if status != PASS:
+ raise Exception("Unable to destroy diskpool %s"
+ % test_pool[i])
+ status = diskpool_undefine(test_pool[i], options.ip, options.virt)
+ if status != PASS:
+ raise Exception("Unable to undefine diskpool %s"
+ % test_pool[i])
+ except Exception, details:
+ logger.error("Invoke CreateChildResourcePool() error when "
+ "create %s", dp_id)
+ logger.error(details)
+ return FAIL
+
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
diff -r e8dc06eefada -r e1be3bd47b80 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Apr 21 17:08:06 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Thu Apr 23 02:37:31 2009 -0700
@@ -190,7 +190,23 @@
cmd = "virsh -c %s net-destroy %s" % (virt2uri(virt), network)
ret, out = utils.run_remote(server, cmd)
- return ret
+ return ret
+
+def diskpool_destroy(diskpool, server, virt="Xen"):
+ """Function destroys a given virtual diskpool"""
+
+ cmd = "virsh -c %s pool-destroy %s" % (virt2uri(virt), diskpool)
+ ret, out = utils.run_remote(server, cmd)
+
+ return ret
+
+def diskpool_undefine(diskpool, server, virt="Xen"):
+ """Function undefines a given virtual diskpool"""
+
+ cmd = "virsh -c %s pool-undefine %s" % (virt2uri(virt), diskpool)
+ ret, out = utils.run_remote(server, cmd)
+
+ return ret
def network_by_bridge(bridge, server, virt="Xen"):
"""Function returns virtual network for a given bridge"""
15 years, 7 months
[PATCH] [TEST] Update RPCS/07_DeleteResourcePool.py validate that the Network pool can be deleted through the providers
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1240551295 25200
# Node ID f279580cad62f287bdfb01dd817e0d00cc3e7368
# Parent e8dc06eefada41252ba8d27b08fcef8ef6604251
[TEST] Update RPCS/07_DeleteResourcePool.py validate that the Network 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 e8dc06eefada -r f279580cad62 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Tue Apr 21 17:08:06 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Thu Apr 23 22:34:55 2009 -0700
@@ -33,10 +33,12 @@
# 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.
-# REVISIT :
-# --------
-# As of now the DeleteResourcePool() simply throws an Exception.
-# We must improve this tc once the service is implemented.
+#
+# Exception details before Revision 841
+# -----
+# Error code: CIM_ERR_NOT_SUPPORTED
+#
+# After revision 841, the service is implemented
#
# -Date: 20.02.2008
@@ -45,33 +47,84 @@
import pywbem
from XenKvmLib import rpcs_service
from CimTest.Globals import logger
+from CimTest.Globals import CIM_NS
from CimTest.ReturnCodes import FAIL, PASS
-from XenKvmLib.const import do_main, platform_sup
+from XenKvmLib.const import do_main, platform_sup, get_provider_version
+from pywbem.cim_obj import CIMInstanceName, CIMInstance
+from XenKvmLib.enumclass import EnumInstances
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
cim_mname = "DeleteResourcePool"
+libvirt_cim_child_pool_rev = 841
+test_pool = "nat_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)
- 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
-
- logger.error("The execution should not have reached here!!")
- return FAIL
+ 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:
+ nprasd = get_typed_class(options.virt,
+ 'NetPoolResourceAllocationSettingData')
+ np = get_typed_class(options.virt, 'NetworkPool')
+ np_id = 'NetworkPool/%s' % test_pool
+ iname = CIMInstanceName(nprasd,
+ namespace = CIM_NS,
+ keybindings = {'InstanceID':np_id})
+ np_prop = {
+ "Address" : "192.168.0.20",
+ "Netmask" : "255.255.255.0",
+ "IPRangeStart" : "192.168.0.21",
+ "IPRangeEnd" : "192.168.0.30"
+ }
+ nrasd = CIMInstance(nprasd, path = iname, properties = np_prop)
+ try:
+ rpcs_conn.CreateChildResourcePool(ElementName=test_pool,
+ Settings=[nrasd.tomof()])
+ netpool = EnumInstances(options.ip, np)
+ if len(netpool) < 1:
+ raise Exception("Return %i instances, expected at least"\
+ "one instance" % len(netpool))
+ for i in range(0, len(netpool)):
+ ret_pool = netpool[i].InstanceID
+ if ret_pool == np_id:
+ break
+ elif ret_pool != np_id and i == len(netpool) - 1:
+ raise Exception("Can not find expected pool")
+
+ pool = CIMInstanceName(np, keybindings = {'InstanceID':np_id})
+ rpcs_conn.DeleteResourcePool(Pool = pool)
+ netpool = EnumInstances(options.ip, np)
+ if len(netpool) < 1:
+ status = PASS
+ else:
+ for i in range(0, len(netpool)):
+ ret_pool = netpool[i].InstanceID
+ if ret_pool == np_id:
+ raise Exception("Failed to delete %s" % test_pool)
+ break
+ elif ret_pool != np_id and i == len(netpool) -1:
+ status = PASS
+ except Exception, details:
+ logger.error(details)
+ return status
+
+ return status
if __name__ == "__main__":
sys.exit(main())
-
15 years, 7 months
[PATCH] [TEST] (#2) Improve enum volumes
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1240002683 25200
# Node ID eea660ff3ad6e589f76bf17b3697d30465e54398
# Parent ced161a8198115797a6036f3f22e02d234439a76
[TEST] (#2) Improve enum volumes
The providers don't return a template RASD for volumes that libvirt is
unable to get volume info for. So the testsuite needs to do the same.
Also, don't use a hardcoded disk pool name - use the default value from const.py
Updates:
-Remove test code
-Allow caller to specify pool name, or use default pool name if one isn't
specified
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r ced161a81981 -r eea660ff3ad6 suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Wed Apr 15 20:19:31 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Fri Apr 17 14:11:23 2009 -0700
@@ -24,7 +24,7 @@
from CimTest.Globals import logger
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.classes import get_typed_class
-from XenKvmLib.const import get_provider_version
+from XenKvmLib.const import get_provider_version, default_pool_name
from XenKvmLib.enumclass import EnumInstances
from VirtLib.utils import run_remote
from XenKvmLib.xm_virt_util import virt2uri
@@ -80,16 +80,20 @@
return pool_insts, PASS
-def enum_volumes(virt, server):
+def enum_volumes(virt, server, pooln=default_pool_name):
volume = 0
cmd = "virsh -c %s vol-list %s | sed -e '1,2 d' -e '$ d'" % \
- (virt2uri(virt), 'cimtest-diskpool')
+ (virt2uri(virt), default_pool_name)
ret, out = run_remote(server ,cmd)
if ret != 0:
return None
lines = out.split("\n")
for line in lines:
- volume = volume + 1
+ vol = line.split()[0]
+ cmd = "virsh -c %s vol-info --pool %s %s" % (virt2uri(virt), pooln, vol)
+ ret, out = run_remote(server ,cmd)
+ if ret == 0:
+ volume = volume + 1
return volume
15 years, 7 months