[PATCH] [TEST] Fix VSSS to work with older versions of libvirt-cim
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1247507590 25200
# Node ID 46932b337bb4387cb8366cb9529d73e212e11c1d
# Parent de91439de07c3cc8e3ca5a5e398f3fad35d0a664
[TEST] Fix VSSS to work with older versions of libvirt-cim...
To work with versions that don't return a ResultingSnapshot result from
CreateSnapshot().
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r de91439de07c -r 46932b337bb4 suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/03_create_snapshot.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/03_create_snapshot.py Mon Jul 13 10:45:38 2009 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/03_create_snapshot.py Mon Jul 13 10:53:10 2009 -0700
@@ -28,7 +28,7 @@
from pywbem import cim_types
from CimTest.Globals import logger
from CimTest.ReturnCodes import PASS, FAIL
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from XenKvmLib.vxml import get_class
from XenKvmLib.classes import get_typed_class, inst_to_mof
from XenKvmLib.enumclass import EnumNames, EnumInstances, GetInstance
@@ -41,6 +41,8 @@
SNAPSHOT = cim_types.Uint16(32769)
test_dom = "snapshot_vm"
+libvirt_cim_res_snap_rev = 876
+
def get_cs_ref(virt, ip):
cs_cn = get_typed_class(virt, "ComputerSystem")
@@ -130,7 +132,9 @@
if output[1]['Job'] is None:
raise Exception("CreateSnapshot failed to return a CIM job inst")
- if output[1]['ResultingSnapshot'] is None:
+ rev, changeset = get_provider_version(options.virt, options.ip)
+ if rev >= libvirt_cim_res_snap_rev and \
+ output[1]['ResultingSnapshot'] is None:
raise Exception("CreateSnapshot failed to return ResultingSnapshot")
except Exception, detail:
15 years, 1 month
[PATCH] [TEST] Fix RPCS to work with older versions of libvirt-cim
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1247507138 25200
# Node ID de91439de07c3cc8e3ca5a5e398f3fad35d0a664
# Parent 89d8b84653726ba7508c17a5da75cc695c9da304
[TEST] Fix RPCS to work with older versions of libvirt-cim...
If DiskPoolRASD templates aren't supported, then create_pool() return a SKIP
status error. Return this instead of a FAIL.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 89d8b8465372 -r de91439de07c suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py Mon Jul 13 10:40:57 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/09_DeleteDiskPool.py Mon Jul 13 10:45:38 2009 -0700
@@ -92,7 +92,7 @@
pool_type="DiskPool", mode_type=TYPE)
if status != PASS:
logger.error("Failed to create diskpool '%s'", test_pool)
- return FAIL
+ return status
status = verify_pool(server, virt, test_pool,
pool_attr, pool_type="DiskPool")
15 years, 1 month
[PATCH] [TEST] Fix RPCS 08 to work with older version of libvirt-cim
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1247506857 25200
# Node ID 89d8b84653726ba7508c17a5da75cc695c9da304
# Parent 3a4e961d8628698392edcc1f0943281f219ff658
[TEST] Fix RPCS 08 to work with older version of libvirt-cim...
For versions that don't support dir, netfs pool creation, or DiskPoolRASD
templates.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 3a4e961d8628 -r 89d8b8465372 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon Jul 13 10:04:05 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon Jul 13 10:40:57 2009 -0700
@@ -61,9 +61,11 @@
libvirt_disk_pool_support=837
libvirt_netfs_pool_support=869
-def get_pool_attr(server, pool_type, dp_types):
+def get_pool_attr(server, pool_type, dp_types, rev):
pool_attr = { "Path" : "/tmp" }
- if pool_type == dp_types['DISK_POOL_NETFS']:
+
+ if rev >= libvirt_netfs_pool_support and \
+ pool_type == dp_types['DISK_POOL_NETFS']:
status , src_mnt_dir, dir_mnt_dir = nfs_netfs_setup(server)
if status != PASS:
logger.error("Failed to get pool_attr for NETFS diskpool type")
@@ -107,7 +109,8 @@
try:
logger.info("Verifying '%s'.....", key)
test_pool = key
- status, pool_attr = get_pool_attr(server, value, dp_types)
+ status, pool_attr = get_pool_attr(server, value, dp_types,
+ curr_cim_rev)
if status != PASS:
return FAIL
@@ -144,6 +147,8 @@
logger.error("Exception details: %s", details)
if key == 'DISK_POOL_NETFS':
netfs_cleanup(server, pool_attr)
+ if status == SKIP:
+ return status
return FAIL
return status
15 years, 1 month
[PATCH] [TEST] For NetworkPoolRASDs, be sure to return a value in all cases
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1247504645 25200
# Node ID 3a4e961d8628698392edcc1f0943281f219ff658
# Parent 66daf8a0a7da34f4135e83cf9398ece22bb2738b
[TEST] For NetworkPoolRASDs, be sure to return a value in all cases
If both if conditions aren't met, we still need to return a default value.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 66daf8a0a7da -r 3a4e961d8628 suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Jul 01 11:23:00 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Jul 13 10:04:05 2009 -0700
@@ -368,6 +368,8 @@
return exp_base_num * dev_types * net_types
+ return exp_base_num
+
def get_exp_template_rasd_len(virt, ip, id):
curr_cim_rev, changeset = get_provider_version(virt, ip)
15 years, 1 month
[PATCH] [TEST] Added logical pool support to create_verify_storagepool.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B.Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1247507891 25200
# Node ID 6d123f20bb563f881233713ef90fa31496cae3a4
# Parent 66daf8a0a7da34f4135e83cf9398ece22bb2738b
[TEST] Added logical pool support to create_verify_storagepool.py.
Verified with Xen and current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 66daf8a0a7da -r 6d123f20bb56 suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py
--- a/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Wed Jul 01 11:23:00 2009 -0700
+++ b/suites/libvirt-cim/misc_cimtests/create_verify_storagepool.py Mon Jul 13 10:58:11 2009 -0700
@@ -26,9 +26,16 @@
#
# The test case is not run in the batch run and we need to run it using
# the following command:
-# python create_verify_storagepool.py -t 2 -d /dev/sda4 -m /tmp/mnt -n diskfs
+# For Fs pool type:
+# ----------------
+# python create_verify_storagepool.py -t fs -d /dev/sda4 -m /tmp/mnt -n diskfs
# -v Xen -u <username> -p <passwd>
#
+# For logical pool type:
+# ----------------------
+# python create_verify_storagepool.py -t logical -d /dev/VolGroup01
+# -n VolGroup01 -v Xen -u <username> -p <passwd>
+#
# Where t can be :
# 2 - FileSystem
# 4 - Logical etc
@@ -45,26 +52,27 @@
sys.path.append('../../../lib')
from CimTest import Globals
from CimTest.Globals import logger, log_param
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, SKIP
sys.path.append('../lib')
from XenKvmLib.classes import inst_to_mof, get_typed_class
from XenKvmLib.pool import get_pool_rasds
from XenKvmLib.common_util import pre_check
from XenKvmLib.enumclass import EnumInstances
+from XenKvmLib.const import get_provider_version
TEST_LOG="cimtest.log"
+libvirt_cim_fs_changes = 857
+libvirt_cim_logical_changes = 906
+
supp_types = [ 'Xen', 'KVM' , 'LXC' ]
-pool_types = { 'DISK_POOL_FS' : 2 }
+pool_types = { 'DISK_POOL_FS' : 2 , 'DISK_POOL_LOGICAL' : 6 }
-def verify_cmd_options(options):
+def verify_cmd_options(options, parser):
try:
if options.part_dev == None:
raise Exception("Free Partition to be mounted not specified")
- if options.mnt_pt == None:
- raise Exception("Mount points to be used not specified")
-
if options.pool_name == None:
raise Exception("Must specify the Pool Name to be created")
@@ -74,8 +82,11 @@
if options.pool_type == None:
raise Exception("Must specify pool type to be tested")
+ if options.mnt_pt == None and options.pool_type != 'logical':
+ raise Exception("Mount points to be used not specified")
+
except Exception, details:
- print "FATAL: ", details
+ print "\nFATAL: ", details , "\n"
print parser.print_help()
return FAIL
@@ -101,13 +112,37 @@
def get_pooltype(pooltype, virt):
if pooltype == "fs":
pool_type = pool_types['DISK_POOL_FS']
+ elif pooltype == "logical":
+ pool_type = pool_types['DISK_POOL_LOGICAL']
else:
logger.error("Invalid pool type ....")
return None, None
return PASS, pool_type
-def verify_inputs(part_dev, mount_pt):
+def verify_inputs(part_dev, mount_pt, pool_type, pool_name):
del_dir = False
+
+ if pool_type == pool_types['DISK_POOL_LOGICAL']:
+ if not os.path.exists("/sbin/lvm"):
+ logger.error("LVM support does not exist on the machine")
+ return FAIL, del_dir
+
+ cmd = "lvm vgs | sed '1 d' 2>>/dev/null"
+ status, output = getstatusoutput(cmd)
+ if status != PASS:
+ logger.error("Failed to get lvm output")
+ return FAIL, del_dir
+
+ vgname_list = []
+ for line in output.split('\n'):
+ vgname_list.append(line.split()[0])
+
+ if not pool_name in vgname_list:
+ logger.error("Please specify existing VolGroup for Poolname")
+ return FAIL, del_dir
+
+ return PASS, del_dir
+
cmd = "mount"
status, mount_info = getstatusoutput(cmd)
if status != PASS:
@@ -165,10 +200,13 @@
for dpool_rasd in dp_rasds:
if dpool_rasd['Type'] == pooltype and \
dpool_rasd['InstanceID'] == 'Default':
- dpool_rasd['DevicePaths'] = [part_dev]
- dpool_rasd['Path'] = mount_pt
dp_pid = "%s/%s" % ("DiskPool", pool_name)
dpool_rasd['PoolID'] = dpool_rasd['InstanceID'] = dp_pid
+ if pooltype == pool_types['DISK_POOL_FS']:
+ dpool_rasd['Path'] = mount_pt
+ dpool_rasd['DevicePaths'] = [part_dev]
+ elif pooltype == pool_types['DISK_POOL_LOGICAL']:
+ dpool_rasd['Path'] = part_dev
break
if not pool_name in dpool_rasd['InstanceID']:
@@ -234,13 +272,14 @@
parser.add_option("-t", "--pool-type", dest="pool_type", default=None,
help="Pool type:[ fs | logical ]")
parser.add_option("-d", "--part-dev", dest="part_dev", default=None,
- help="specify the free partition to be used")
+ help="specify the free partition to be used for " \
+ "fs pool type or the predefined Vol Group" \
+ " for logical pool type")
parser.add_option("-m", "--mnt_pt", dest="mnt_pt", default=None,
help="Mount point to be used")
parser.add_option("-n", "--pool-name", dest="pool_name", default=None,
help="Pool to be created")
- parser.add_option("-c", "--clean-log",
- action="store_true", dest="clean",
+ parser.add_option("-c", "--clean-log", action="store_true", dest="clean",
help="Will remove existing log files before test run")
parser.add_option("-l", "--debug-output", action="store_true", dest="debug",
help="Duplicate the output to stderr")
@@ -248,7 +287,7 @@
(options, args) = parser.parse_args()
# Verify command line options
- status = verify_cmd_options(options)
+ status = verify_cmd_options(options, parser)
if status != PASS:
return status
@@ -275,10 +314,28 @@
status, pooltype = get_pooltype(options.pool_type, virt)
if status != PASS:
return FAIL
+
+ os.environ['CIM_NS'] = Globals.CIM_NS = options.ns
+ os.environ['CIM_USER'] = Globals.CIM_USER = options.username
+ os.environ['CIM_PASS'] = Globals.CIM_PASS = options.password
+
+ curr_cim_rev, changeset = get_provider_version(virt, sysname)
+ if curr_cim_rev < libvirt_cim_fs_changes and \
+ pooltype == pool_types['DISK_POOL_FS']:
+ logger.info("Test Skipped for %s pool type, Support for File System "\
+ "Pool is available in revision %s", options.pool_type,
+ libvirt_cim_fs_changes)
+ return SKIP
+ elif curr_cim_rev < libvirt_cim_logical_changes and \
+ pooltype == pool_types['DISK_POOL_LOGICAL']:
+ logger.info("Test Skipped for %s pool type, Support for Logical Pool" \
+ " is available in revision %s", options.pool_type, \
+ libvirt_cim_logical_changes)
+ return SKIP
pooltype = cim_types.Uint16(pooltype)
- status, del_dir = verify_inputs(part_dev, mount_pt)
+ status, del_dir = verify_inputs(part_dev, mount_pt, pooltype, pool_name)
if status != PASS:
if del_dir == True:
cmd ="rm -rf %s" % mount_pt
@@ -286,10 +343,6 @@
logger.error("Input verification failed")
return status
-
- os.environ['CIM_NS'] = Globals.CIM_NS = options.ns
- os.environ['CIM_USER'] = Globals.CIM_USER = options.username
- os.environ['CIM_PASS'] = Globals.CIM_PASS = options.password
cn = "DiskPool"
dp_cn = get_typed_class(virt, cn)
dp_id = "%s/%s" % (cn, pool_name)
@@ -299,6 +352,9 @@
if status == PASS:
logger.error("Pool --> '%s' already exist", pool_name)
logger.error("Specify some other pool name")
+ if del_dir == True:
+ cmd ="rm -rf %s" % mount_pt
+ status, out = getstatusoutput(cmd)
return status
res = [FAIL]
15 years, 2 months
[PATCH 0 of 3] [Test] Patches to test bridge interface
by Yogananth Subramanian
Hello everyone,
I like to submit a set of patches to enable and test bridge interface uisng
cimtest.
The first patch,'patch1', enables to create domain with bridge interface.
The seocnd patch,'patch2', is a testcase to test the above feature.
The third parthc,'patch3', is a testcase to verify various error conditions
with both 'network' and 'bridge' network type.
Thanks and Regards
Yogi
15 years, 2 months
[PATCH] Enum instance of net RASD wasn't parsing network name properly
by Sharad Mishra
# HG changeset patch
# User snmishra(a)us.ibm.com
# Date 1247001210 25200
# Node ID 78a5d3cd29f9a5596e42437ceed49626b7674460
# Parent 2f0fb9e5d52301fc00212d543d593e24d89ba0f0
Enum instance of net RASD wasn't parsing network name properly.
Updated device parsing code and net RASD to get network name for
bridge devices.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 2f0fb9e5d523 -r 78a5d3cd29f9 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Wed Jun 24 11:46:08 2009 -0700
+++ b/libxkutil/device_parsing.c Tue Jul 07 14:13:30 2009 -0700
@@ -307,8 +307,8 @@
if (ndev->mac == NULL)
goto err;
} else if (XSTREQ(child->name, "source")) {
- ndev->source = get_attr_value(child, "bridge");
- if (ndev->source != NULL)
+ ndev->name = get_attr_value(child, "bridge");
+ if (ndev->name != NULL)
continue;
ndev->source = get_attr_value(child, "network");
if (ndev->source != NULL)
diff -r 2f0fb9e5d523 -r 78a5d3cd29f9 src/Virt_RASD.c
--- a/src/Virt_RASD.c Wed Jun 24 11:46:08 2009 -0700
+++ b/src/Virt_RASD.c Tue Jul 07 14:13:30 2009 -0700
@@ -404,6 +404,13 @@
(CMPIValue *)dev->dev.net.mac,
CMPI_chars);
+ if ((dev->dev.net.name != NULL) &&
+ (STREQ(dev->dev.net.type, "bridge")))
+ CMSetProperty(inst,
+ "NetworkName",
+ (CMPIValue *)dev->dev.net.name,
+ CMPI_chars);
+
if (dev->dev.net.model != NULL)
CMSetProperty(inst,
"ResourceSubType",
15 years, 2 months