# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1210684825 25200
# Node ID cf44a468be8440eb3b09c9a43804af7ecf5f9ae0
# Parent a6ffa074aab4b3867358eb77c0dcc7c622c595d4
[TEST] Updating 01_forward.py of SDC.
To use the storage pool present on the machine.
This tc will now pass on latest libvirt-cim for KVM.
This tc will require virsh_version() and diskpool_list() and create_diskpool() function
changes to work.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r a6ffa074aab4 -r cf44a468be84
suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Tue May 13
06:12:22 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Tue May 13
06:20:25 2008 -0700
@@ -59,17 +59,16 @@ from XenKvmLib import enumclass
from XenKvmLib import enumclass
from XenKvmLib.test_xml import netxml
from XenKvmLib.test_doms import create_vnet
-from VirtLib.live import net_list
+from VirtLib.live import net_list, virsh_version
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from CimTest.Globals import do_main, platform_sup, logger, \
CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
-create_diskpool_file
+create_diskpool_file, diskpoolconf_rev, create_diskpool, dpoolname
from XenKvmLib.common_util import print_field_error
from XenKvmLib.const import CIM_REV
-diskid = "%s/%s" % ("DiskPool", test_dpath)
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
libvirtcim_sdc_rasd_rev = 571
@@ -130,6 +129,18 @@ def get_pool_details(virt, server):
def get_pool_details(virt, server):
dpool = npool = mpool = ppool = None
try :
+ libvirt_version = virsh_version(server, virt)
+ if virt == 'KVM' and libvirt_version >= '0.4.1' and \
+ CIM_REV > diskpoolconf_rev:
+ diskid = "%s/%s" % ("DiskPool", dpoolname)
+ status = create_diskpool(server, virt=virt)
+ else:
+ diskid = "%s/%s" % ("DiskPool", test_dpath)
+ status = create_diskpool_file()
+
+ if status != PASS:
+ return status, dpool, npool, mpool, ppool
+
dpool = get_pool_info(virt, server, diskid, poolname="DiskPool")
mpool = get_pool_info(virt, server, memid, poolname= "MemoryPool")
ppool = get_pool_info(virt, server, procid, poolname= "ProcessorPool")
@@ -145,7 +156,7 @@ def get_pool_details(virt, server):
if not ret:
logger.error("Failed to create Virtual Network '%s'",
test_network)
- return SKIP
+ return SKIP, dpool, npool, mpool, ppool
netid = "%s/%s" % ("NetworkPool", test_network)
npool = get_pool_info(virt, server, netid, poolname= "NetworkPool")
@@ -225,11 +236,6 @@ def main():
server = options.ip
virt = options.virt
- # Verify DiskPool on machine
- status = create_diskpool_file()
- if status != PASS:
- return status
-
status, dpool, npool, mpool, ppool = get_pool_details(virt, server)
if status != PASS or dpool.InstanceID == None or mpool.InstanceID == None \
or npool.InstanceID == None or ppool.InstanceID == None: