[PATCH] [TEST] #2 Fixing 04_hs_to_EAPF.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1218631664 25200
# Node ID d408db44715b1e88637a9b0248c5f5b05919c3bf
# Parent d1c7391bcfe9f1ab85effa7e8fa5c21063c8e1f7
[TEST] #2 Fixing 04_hs_to_EAPF.py tc.
Changes:
-------
Patch 2:
--------
1) Improved the pool_init_list() function.
2) Moved the logic for creating the input pool list to pool_init_list().
Patch 1:
--------
1) Fixed the 04_hs_to_EAPF.py tc.
2) Set test_disk appropriately.
3) Improved pool_init_list() fn to include only pool info belonging to which the VS belongs.
4) Cleaned up unnecessary declarations and import stmt.
5) Replaced create_diskpool_file() function to create a DiskPool, with create_diskpool_conf() which calls either creating of diskconf file or using the diskpool
depending on the version of the libvirt on the machine.
Tested with Xen, XenFV and KVM on latest sources.
This tc might not work on LXC with these changes.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r d1c7391bcfe9 -r d408db44715b suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py
--- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Wed Aug 13 05:47:44 2008 -0700
@@ -59,8 +59,8 @@ from CimTest.ReturnCodes import PASS, FA
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.logicaldevices import verify_device_values
-from XenKvmLib.common_util import cleanup_restore, test_dpath, \
-create_diskpool_file, create_netpool_conf, destroy_netpool
+from XenKvmLib.common_util import cleanup_restore, \
+create_diskpool_conf, destroy_netpool
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -68,27 +68,40 @@ test_mac = "00:11:22:33:44:aa"
test_mac = "00:11:22:33:44:aa"
test_mem = 128
test_vcpus = 1
-test_disk = "xvdb"
-diskid = "%s/%s" % ("DiskPool", test_dpath)
-memid = "%s/%s" % ("MemoryPool", 0)
-procid = "%s/%s" % ("ProcessorPool", 0)
def print_err(err, detail, cn):
logger.error(err % cn)
logger.error("Exception: %s", detail)
-def pool_init_list(pool_assoc):
+def pool_init_list(virt, pool_assoc, net_name, dp_InstID):
"""
Creating the lists that will be used for comparisons.
"""
in_pllist = {}
- for i in range(len(pool_assoc)):
- classname_keyvalue = pool_assoc[i].classname
- instid = pool_assoc[i]['InstanceID']
- in_pllist[classname_keyvalue] = instid
+ mpool = get_typed_class(virt, 'MemoryPool')
+
+ exp_pllist = {
+ mpool : 'MemoryPool/0'
+ }
+
+ if virt != 'LXC':
+ npool = get_typed_class(virt, 'NetworkPool')
+ dpool = get_typed_class(virt, 'DiskPool')
+ ppool = get_typed_class(virt, 'ProcessorPool')
+ exp_pllist[dpool] = dp_InstID
+ exp_pllist[npool] = '%s/%s' %('NetworkPool', net_name)
+ exp_pllist[ppool] = 'ProcessorPool/0'
+ exp_pllist[mpool] = 'MemoryPool/0'
+
+ for p_inst in pool_assoc:
+ CName = p_inst.classname
+ InstID = p_inst['InstanceID']
+ if exp_pllist[CName] == InstID:
+ in_pllist[CName] = InstID
+
return in_pllist
-def eapf_list(server, virt="Xen"):
+def eapf_list(server, virt, test_disk):
disk_inst = get_typed_class(virt, "LogicalDisk")
proc_inst = get_typed_class(virt, "Processor")
net_inst = get_typed_class(virt, "NetworkPort")
@@ -136,7 +149,7 @@ def get_inst_for_dom(assoc_val):
return dom_list
-def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"):
+def get_assocname_info(server, cn, an, qcn, hostname, virt):
status = PASS
assoc_info = []
try:
@@ -155,9 +168,6 @@ def get_assocname_info(server, cn, an, q
print_err(CIM_ERROR_ASSOCIATORNAMES, detail, cn)
status = FAIL
- if status != PASS:
- cleanup_restore(server, virt='Xen')
-
return status, assoc_info
def check_len(an, assoc_list_info, qcn, exp_len):
@@ -167,14 +177,14 @@ def check_len(an, assoc_list_info, qcn,
return FAIL
return PASS
-def verify_eafp_values(server, in_pllist, virt="Xen"):
+def verify_eafp_values(server, in_pllist, virt, test_disk):
# Looping through the in_pllist to get association for various pools.
status = PASS
an = get_typed_class(virt, "ElementAllocatedFromPool")
exp_len = 1
- qcn = "Logical Devices"
- eafp_values = eapf_list(server, virt)
+ eafp_values = eapf_list(server, virt, test_disk)
for cn, instid in sorted(in_pllist.items()):
+ qcn = cn
try:
assoc_info = Associators(server, an, cn, virt, InstanceID = instid)
inst_list = get_inst_for_dom(assoc_info)
@@ -185,14 +195,12 @@ def verify_eafp_values(server, in_pllist
CCName = assoc_eafp_info['CreationClassName']
status = verify_device_values(assoc_eafp_info,
eafp_values, virt)
-
if status != PASS:
return status
-
except Exception, detail:
logger.error(CIM_ERROR_ASSOCIATORS, an)
logger.error("Exception: %s", detail)
- cleanup_restore(server, virt='Xen')
+ cleanup_restore(server, virt)
status = FAIL
return status
@@ -200,38 +208,37 @@ def main():
def main():
options= main.options
server = options.ip
- if options.virt == "XenFV":
- virt = "Xen"
- else:
- virt=options.virt
+ virt=options.virt
# Get the host info
status, host_name, classname = get_host_info(server, virt)
if status != PASS:
return status
+
destroy_and_undefine_all(server)
+ if virt == 'Xen':
+ test_disk = 'xvdb'
+ else:
+ test_disk = 'hdb'
+
virt_type = get_class(virt)
if virt == 'LXC':
- vsxml = virt_type(test_dom)
+ vsxml = virt_type(test_dom, ntype="network")
else:
vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac,
- disk = test_disk)
+ disk = test_disk, ntype="network")
ret = vsxml.define(server)
if not ret:
logger.error("Failed to define the dom: '%s'", test_dom)
return FAIL
- # Verify DiskPool on machine
- status = create_diskpool_file()
+
+ # Get the network pool info which is used by the VS.
+ net_name = vsxml.xml_get_net_network()
+
+ status, dpool_name = create_diskpool_conf(server, virt)
if status != PASS:
logger.error("Failed to create diskpool")
- vsxml.undefine(server)
- return FAIL
- # Create NetPool on machine
- status, net_name = create_netpool_conf(server, virt, use_existing=False)
- if status != PASS:
- logger.error('Unable to create network pool')
vsxml.undefine(server)
- cleanup_restore(server, virt=virt)
return FAIL
# Get the hostedResourcePool info first
@@ -244,22 +251,18 @@ def main():
cleanup_restore(server, virt=virt)
destroy_netpool(server, virt, net_name)
return status
+
+ in_pllist = pool_init_list(virt, pool, net_name, dpool_name)
# One pool for each Device type, hence len should be 4
exp_len = 4
- status = check_len(an, pool, qcn, exp_len)
+ status = check_len(an, in_pllist, qcn, exp_len)
if status != PASS:
vsxml.undefine(server)
cleanup_restore(server, virt=virt)
destroy_netpool(server, virt, net_name)
return FAIL
- in_pllist = pool_init_list(pool)
- if virt == 'LXC':
- for cn, instid in in_pllist.items():
- if cn == 'LXC_MemoryPool':
- in_pllist = {cn: instid}
- break
- status = verify_eafp_values(server, in_pllist, virt)
+ status = verify_eafp_values(server, in_pllist, virt, test_disk)
vsxml.undefine(server)
cleanup_restore(server, virt=virt)
destroy_netpool(server, virt, net_name)
16 years, 4 months
[PATCH] [TEST] Fixing 04_hs_to_EAPF.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1218478580 25200
# Node ID 3eca51b419cc44654c94c21f32c4361632a43fac
# Parent 0b5dea4e96cd0e128c0da6019cc545964deeba49
[TEST] Fixing 04_hs_to_EAPF.py tc.
1) Fixed the 04_hs_to_EAPF.py tc.
2) Set test_disk appropriately.
3) Improved pool_init_list() fn to include only pool info belonging to which the VS belongs.
4) Cleaned up unnecessary declarations and import stmt.
5) Replaced create_diskpool_file() function to create a DiskPool, with create_diskpool_conf() which calls either creating of diskconf file or using the diskpool
depending on the version of the libvirt on the machine.
Tested with Xen, XenFV and KVM on latest sources.
This tc might not work on LXC with these changes.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 0b5dea4e96cd -r 3eca51b419cc suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py
--- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Mon Aug 11 00:42:50 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Mon Aug 11 11:16:20 2008 -0700
@@ -59,8 +59,8 @@ from CimTest.ReturnCodes import PASS, FA
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.logicaldevices import verify_device_values
-from XenKvmLib.common_util import cleanup_restore, test_dpath, \
-create_diskpool_file, create_netpool_conf, destroy_netpool
+from XenKvmLib.common_util import cleanup_restore, \
+create_diskpool_conf, destroy_netpool
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -68,27 +68,34 @@ test_mac = "00:11:22:33:44:aa"
test_mac = "00:11:22:33:44:aa"
test_mem = 128
test_vcpus = 1
-test_disk = "xvdb"
-diskid = "%s/%s" % ("DiskPool", test_dpath)
-memid = "%s/%s" % ("MemoryPool", 0)
-procid = "%s/%s" % ("ProcessorPool", 0)
def print_err(err, detail, cn):
logger.error(err % cn)
logger.error("Exception: %s", detail)
-def pool_init_list(pool_assoc):
+def pool_init_list(virt, pool_assoc, net_name, dpool_name):
"""
Creating the lists that will be used for comparisons.
"""
in_pllist = {}
+ npool = get_typed_class(virt, 'NetworkPool')
+ dpool = get_typed_class(virt, 'DiskPool')
+ ppool = get_typed_class(virt, 'ProcessorPool')
+ mpool = get_typed_class(virt, 'MemoryPool')
+ n_instid = '%s/%s' % ('NetworkPool', net_name)
+
for i in range(len(pool_assoc)):
classname_keyvalue = pool_assoc[i].classname
instid = pool_assoc[i]['InstanceID']
- in_pllist[classname_keyvalue] = instid
+ if classname_keyvalue == npool and instid == n_instid:
+ in_pllist[classname_keyvalue] = instid
+ elif classname_keyvalue == dpool and instid == dpool_name:
+ in_pllist[classname_keyvalue] = instid
+ elif classname_keyvalue == ppool or classname_keyvalue == mpool:
+ in_pllist[classname_keyvalue] = instid
return in_pllist
-def eapf_list(server, virt="Xen"):
+def eapf_list(server, virt, test_disk):
disk_inst = get_typed_class(virt, "LogicalDisk")
proc_inst = get_typed_class(virt, "Processor")
net_inst = get_typed_class(virt, "NetworkPort")
@@ -136,7 +143,7 @@ def get_inst_for_dom(assoc_val):
return dom_list
-def get_assocname_info(server, cn, an, qcn, hostname, virt="Xen"):
+def get_assocname_info(server, cn, an, qcn, hostname, virt):
status = PASS
assoc_info = []
try:
@@ -155,9 +162,6 @@ def get_assocname_info(server, cn, an, q
print_err(CIM_ERROR_ASSOCIATORNAMES, detail, cn)
status = FAIL
- if status != PASS:
- cleanup_restore(server, virt='Xen')
-
return status, assoc_info
def check_len(an, assoc_list_info, qcn, exp_len):
@@ -167,14 +171,14 @@ def check_len(an, assoc_list_info, qcn,
return FAIL
return PASS
-def verify_eafp_values(server, in_pllist, virt="Xen"):
+def verify_eafp_values(server, in_pllist, virt, test_disk):
# Looping through the in_pllist to get association for various pools.
status = PASS
an = get_typed_class(virt, "ElementAllocatedFromPool")
exp_len = 1
- qcn = "Logical Devices"
- eafp_values = eapf_list(server, virt)
+ eafp_values = eapf_list(server, virt, test_disk)
for cn, instid in sorted(in_pllist.items()):
+ qcn = cn
try:
assoc_info = Associators(server, an, cn, virt, InstanceID = instid)
inst_list = get_inst_for_dom(assoc_info)
@@ -185,14 +189,12 @@ def verify_eafp_values(server, in_pllist
CCName = assoc_eafp_info['CreationClassName']
status = verify_device_values(assoc_eafp_info,
eafp_values, virt)
-
if status != PASS:
return status
-
except Exception, detail:
logger.error(CIM_ERROR_ASSOCIATORS, an)
logger.error("Exception: %s", detail)
- cleanup_restore(server, virt='Xen')
+ cleanup_restore(server, virt)
status = FAIL
return status
@@ -200,38 +202,37 @@ def main():
def main():
options= main.options
server = options.ip
- if options.virt == "XenFV":
- virt = "Xen"
- else:
- virt=options.virt
+ virt=options.virt
# Get the host info
status, host_name, classname = get_host_info(server, virt)
if status != PASS:
return status
+
destroy_and_undefine_all(server)
+ if virt == 'Xen':
+ test_disk = 'xvdb'
+ else:
+ test_disk = 'hdb'
+
virt_type = get_class(virt)
if virt == 'LXC':
- vsxml = virt_type(test_dom)
+ vsxml = virt_type(test_dom, ntype="network")
else:
vsxml = virt_type(test_dom, vcpus = test_vcpus, mac = test_mac,
- disk = test_disk)
+ disk = test_disk, ntype="network")
ret = vsxml.define(server)
if not ret:
logger.error("Failed to define the dom: '%s'", test_dom)
return FAIL
- # Verify DiskPool on machine
- status = create_diskpool_file()
+
+ # Get the network pool info which is used by the VS.
+ net_name = vsxml.xml_get_net_network()
+
+ status, dpool_name = create_diskpool_conf(server, virt)
if status != PASS:
logger.error("Failed to create diskpool")
- vsxml.undefine(server)
- return FAIL
- # Create NetPool on machine
- status, net_name = create_netpool_conf(server, virt, use_existing=False)
- if status != PASS:
- logger.error('Unable to create network pool')
vsxml.undefine(server)
- cleanup_restore(server, virt=virt)
return FAIL
# Get the hostedResourcePool info first
@@ -244,6 +245,7 @@ def main():
cleanup_restore(server, virt=virt)
destroy_netpool(server, virt, net_name)
return status
+
# One pool for each Device type, hence len should be 4
exp_len = 4
status = check_len(an, pool, qcn, exp_len)
@@ -253,13 +255,14 @@ def main():
destroy_netpool(server, virt, net_name)
return FAIL
- in_pllist = pool_init_list(pool)
+ in_pllist = pool_init_list(virt, pool, net_name, dpool_name)
if virt == 'LXC':
for cn, instid in in_pllist.items():
if cn == 'LXC_MemoryPool':
in_pllist = {cn: instid}
break
- status = verify_eafp_values(server, in_pllist, virt)
+
+ status = verify_eafp_values(server, in_pllist, virt, test_disk)
vsxml.undefine(server)
cleanup_restore(server, virt=virt)
destroy_netpool(server, virt, net_name)
16 years, 4 months
[PATCH] [TEST] Fix logger error in VSMS - 10_hv_version.py
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1218628069 25200
# Node ID 2733481ee6603800a4ba143d3ec467326f51692e
# Parent d1c7391bcfe9f1ab85effa7e8fa5c21063c8e1f7
[TEST] Fix logger error in VSMS - 10_hv_version.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r d1c7391bcfe9 -r 2733481ee660 suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py Wed Aug 13 04:47:49 2008 -0700
@@ -49,7 +49,8 @@
local_ver = live.get_hv_ver(options.ip, options.virt)
if cim_ver != local_ver:
- logger.error("CIM says version is `%s', but libvirt says `%s'")
+ logger.error("CIM says version is `%s', but libvirt says `%s'" \
+ % (cim_ver, local_ver))
return FAIL
else:
logger.info("Verified %s == %s" % (cim_ver, local_ver))
16 years, 4 months
[PATCH] [TEST] Update VSMS - 06_addresource.py to support XenFV
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1218594821 25200
# Node ID e4b5b9850a661c9a16fbc2b8d7fc31e5a78ec6c6
# Parent d1c7391bcfe9f1ab85effa7e8fa5c21063c8e1f7
[TEST] Update VSMS - 06_addresource.py to support XenFV
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r d1c7391bcfe9 -r e4b5b9850a66 suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Tue Aug 12 19:33:41 2008 -0700
@@ -34,7 +34,7 @@
from XenKvmLib import vsms_util
from XenKvmLib.common_util import create_netpool_conf, destroy_netpool
-sup_types = ['Xen', 'KVM']
+sup_types = ['Xen', 'KVM', 'XenFV']
default_dom = 'rstest_domain'
nmac = '99:aa:bb:cc:ee:ff'
ntype = 'network'
16 years, 4 months
[PATCH] [TEST] #2 Just check the error number, fix ResourcePoolConfigurationService.03, 04, 06&07 to work for both Pegasus and sfcb
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1218593453 25200
# Node ID f476a9817c6f5c6140567f3d144c412e7afe494a
# Parent d1c7391bcfe9f1ab85effa7e8fa5c21063c8e1f7
[TEST] #2 Just check the error number, fix ResourcePoolConfigurationService.03,04,06&07 to work for both Pegasus and sfcb
The Pegasus and sfcb return the same error code in this case, but different in error description.
For this specific, we just to check the error number
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r d1c7391bcfe9 -r f476a9817c6f suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/03_CreateResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/03_CreateResourcePool.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/03_CreateResourcePool.py Tue Aug 12 19:10:53 2008 -0700
@@ -47,7 +47,6 @@
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "CreateResourcePool"
@@ -59,7 +58,7 @@
try:
rpcs_conn.CreateResourcePool()
except pywbem.CIMError, (err_no, desc):
- if err_no == cim_errno and desc.find(cim_desc) >= 0 :
+ 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)
diff -r d1c7391bcfe9 -r f476a9817c6f suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Tue Aug 12 19:10:53 2008 -0700
@@ -56,7 +56,6 @@
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "CreateChildResourcePool"
@do_main(platform_sup)
@@ -67,7 +66,7 @@
try:
rpcs_conn.CreateChildResourcePool()
except pywbem.CIMError, (err_no, desc):
- if err_no == cim_errno and desc.find(cim_desc) >= 0 :
+ 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)
diff -r d1c7391bcfe9 -r f476a9817c6f suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py Tue Aug 12 19:10:53 2008 -0700
@@ -54,7 +54,6 @@
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "RemoveResourcesFromResourcePool"
@do_main(platform_sup)
@@ -65,7 +64,7 @@
try:
rpcs_conn.RemoveResourcesFromResourcePool()
except pywbem.CIMError, (err_no, desc):
- if err_no == cim_errno and desc.find(cim_desc) >= 0 :
+ 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)
diff -r d1c7391bcfe9 -r f476a9817c6f suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Tue Aug 12 19:10:53 2008 -0700
@@ -50,7 +50,6 @@
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "DeleteResourcePool"
@do_main(platform_sup)
@@ -61,7 +60,7 @@
try:
rpcs_conn.DeleteResourcePool()
except pywbem.CIMError, (err_no, desc):
- if err_no == cim_errno and desc.find(cim_desc) >= 0 :
+ 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)
16 years, 4 months
[PATCH] [TEST] #2 Fix VSMS-05_destroysystem_neg.py to work for both Pegasus and sfcb
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1218592814 25200
# Node ID c6f6da023a564a0e9fdb33d5aec72af269238a3d
# Parent d1c7391bcfe9f1ab85effa7e8fa5c21063c8e1f7
[TEST] #2 Fix VSMS-05_destroysystem_neg.py to work for both Pegasus and sfcb
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r d1c7391bcfe9 -r c6f6da023a56 suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Tue Aug 12 04:11:28 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Tue Aug 12 19:00:14 2008 -0700
@@ -45,8 +45,7 @@
keybindings = {'CreationClassName':classname})
exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
- 'desc' : 'CIM_ERR_FAILED: Unable to retrieve domain\
- name.'
+ 'desc' : 'Unable to retrieve domain name.'
}
elif tc == 'nonexistent':
@@ -55,7 +54,7 @@
'CreationClassName':classname})
exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
- 'desc' : 'CIM_ERR_FAILED: Failed to find domain'
+ 'desc' : 'Failed to find domain'
}
else:
@@ -68,7 +67,7 @@
except Exception, details:
err_no = details[0]
err_desc = details[1]
- if err_no == exp_value['rc'] and err_desc == exp_value['desc']:
+ if err_no == exp_value['rc'] and err_desc.find(exp_value['desc']) >= 0:
logger.error("For Invalid Scenario '%s'", tc)
logger.info('Got expected error no: %s', err_no)
logger.info('Got expected error desc: %s',err_desc)
16 years, 4 months
[PATCH] [TEST] Fix VSMS - 05_destroysystem_neg.py to work for both Pegasus and sfcb
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1218519475 25200
# Node ID b4a54ba548b4d34c485dc04d1fc5dba257e40446
# Parent 98f69895a4dcc3d314d41611cf67f51329e15a44
[TEST] Fix VSMS - 05_destroysystem_neg.py to work for both Pegasus and sfcb
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 98f69895a4dc -r b4a54ba548b4 suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Fri Aug 08 11:01:29 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Mon Aug 11 22:37:55 2008 -0700
@@ -40,23 +40,35 @@
classname = get_typed_class(options.virt, 'ComputerSystem')
+ cmd = "lsof -P -i:5988 | grep sfcbd"
+ rc, out = utils.run_remote(options.ip, cmd)
+
if tc == 'noname':
cs_ref = CIMInstanceName(classname,
keybindings = {'CreationClassName':classname})
- exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
- 'desc' : 'CIM_ERR_FAILED: Unable to retrieve domain\
- name.'
- }
+ if rc == 0:
+ exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
+ 'desc' : 'Unable to retrieve domain name.'
+ }
+ else:
+ exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
+ 'desc' : 'CIM_ERR_FAILED: Unable to retrieve domain name.'
+ }
elif tc == 'nonexistent':
cs_ref = CIMInstanceName(classname,keybindings = {
'Name':'##@@!!cimtest_domain',
'CreationClassName':classname})
- exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
- 'desc' : 'CIM_ERR_FAILED: Failed to find domain'
- }
+ if rc == 0:
+ exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
+ 'desc' : 'Failed to find domain'
+ }
+ else:
+ exp_value = { 'rc' : pywbem.CIM_ERR_FAILED,
+ 'desc' : 'CIM_ERR_FAILED: Failed to find domain'
+ }
else:
return SKIP
16 years, 4 months
[PATCH] [TEST] Fix ResourcePoolConfigurationService.03, 04, 06&07 to work for both Pegasus and sfcb
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1218520874 25200
# Node ID a8604735c04b457abd35327996fae64eb0d5babe
# Parent 98f69895a4dcc3d314d41611cf67f51329e15a44
[TEST] Fix ResourcePoolConfigurationService.03,04,06&07 to work for both Pegasus and sfcb
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 98f69895a4dc -r a8604735c04b suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/03_CreateResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/03_CreateResourcePool.py Fri Aug 08 11:01:29 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/03_CreateResourcePool.py Mon Aug 11 23:01:14 2008 -0700
@@ -40,6 +40,7 @@
import sys
import pywbem
+from VirtLib import utils
from XenKvmLib import rpcs_service
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
@@ -47,7 +48,6 @@
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "CreateResourcePool"
@@ -56,6 +56,14 @@
options = main.options
rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
"ResourcePoolConfigurationService"))(options.ip)
+
+ cmd = "lsof -P -i:5988 | grep sfcbd"
+ rc, out = utils.run_remote(options.ip, cmd)
+ if rc == 0:
+ cim_desc = "The requested operation is not supported"
+ else:
+ cim_desc = "CIM_ERR_NOT_SUPPORTED"
+
try:
rpcs_conn.CreateResourcePool()
except pywbem.CIMError, (err_no, desc):
diff -r 98f69895a4dc -r a8604735c04b suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Fri Aug 08 11:01:29 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Mon Aug 11 23:01:14 2008 -0700
@@ -50,13 +50,13 @@
import sys
import pywbem
from XenKvmLib import rpcs_service
+from VirtLib import utils
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
from CimTest.Globals import do_main, platform_sup
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "CreateChildResourcePool"
@do_main(platform_sup)
@@ -64,6 +64,13 @@
options = main.options
rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
"ResourcePoolConfigurationService"))(options.ip)
+ cmd = "lsof -P -i:5988 | grep sfcbd"
+ rc, out = utils.run_remote(options.ip, cmd)
+ if rc == 0:
+ cim_desc = "The requested operation is not supported"
+ else:
+ cim_desc = "CIM_ERR_NOT_SUPPORTED"
+
try:
rpcs_conn.CreateChildResourcePool()
except pywbem.CIMError, (err_no, desc):
diff -r 98f69895a4dc -r a8604735c04b suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py Fri Aug 08 11:01:29 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py Mon Aug 11 23:01:14 2008 -0700
@@ -46,7 +46,8 @@
import sys
-import pywbem
+import pywbem
+from VirtLib import utils
from XenKvmLib import rpcs_service
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
@@ -54,7 +55,6 @@
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "RemoveResourcesFromResourcePool"
@do_main(platform_sup)
@@ -62,6 +62,14 @@
options = main.options
rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
"ResourcePoolConfigurationService"))(options.ip)
+
+ cmd = "lsof -P -i:5988 | grep sfcbd"
+ rc, out = utils.run_remote(options.ip, cmd)
+ if rc == 0:
+ cim_desc = "The requested operation is not supported"
+ else:
+ cim_desc = "CIM_ERR_NOT_SUPPORTED"
+
try:
rpcs_conn.RemoveResourcesFromResourcePool()
except pywbem.CIMError, (err_no, desc):
diff -r 98f69895a4dc -r a8604735c04b suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Fri Aug 08 11:01:29 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Mon Aug 11 23:01:14 2008 -0700
@@ -43,6 +43,7 @@
import sys
import pywbem
+from VirtLib import utils
from XenKvmLib import rpcs_service
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
@@ -50,7 +51,6 @@
from XenKvmLib.classes import get_typed_class
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
-cim_desc = "CIM_ERR_NOT_SUPPORTED"
cim_mname = "DeleteResourcePool"
@do_main(platform_sup)
@@ -58,6 +58,13 @@
options = main.options
rpcs_conn = eval("rpcs_service." + get_typed_class(options.virt, \
"ResourcePoolConfigurationService"))(options.ip)
+ cmd = "lsof -P -i:5988 | grep sfcbd"
+ rc, out = utils.run_remote(options.ip, cmd)
+ if rc == 0:
+ cim_desc = "The requested operation is not supported"
+ else:
+ cim_desc = "CIM_ERR_NOT_SUPPORTED"
+
try:
rpcs_conn.DeleteResourcePool()
except pywbem.CIMError, (err_no, desc):
16 years, 4 months