[PATCH] Fix potiential seg fault in parse_id()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1214246238 25200
# Node ID 3d2618df45908eecf363442d50e43297ebd77a62
# Parent e3b5268c1b4e18a7b0bfe48d98d1f1017a4498c6
Fix potiential seg fault in parse_id().
It's possible to hit a seg fault with calling VSSDComponent's vssd_to_rasd(), VSSD's get_vssd_by_ref(), or VirtualSystemSnapshotService's destroy_snapshot().
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r e3b5268c1b4e -r 3d2618df4590 libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Fri Jun 13 18:39:12 2008 -0700
+++ b/libxkutil/misc_util.c Mon Jun 23 11:37:18 2008 -0700
@@ -408,8 +408,8 @@
char **name)
{
int ret;
- char *tmp_pfx;
- char *tmp_name;
+ char *tmp_pfx = NULL;
+ char *tmp_name = NULL;
ret = sscanf(id, "%a[^:]:%as", &tmp_pfx, &tmp_name);
if (ret != 2) {
16 years, 6 months
[PATCH] [TEST] #2 Modifying devices.py to fix tc 01_netport.py which was failing on F9 libvirt-cim rpm
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213940983 25200
# Node ID 2384eeff23be0643b12d908640bef054622c6a41
# Parent 93dbca94a762bb2ba443025db96d43977484c40d
[TEST] #2 Modifying devices.py to fix tc 01_netport.py which was failing on F9 libvirt-cim rpm.
Change in Patch 2
-----------------
Modified the changeset no from 598 to 599.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 93dbca94a762 -r 2384eeff23be suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Thu Jun 19 01:42:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Thu Jun 19 22:49:43 2008 -0700
@@ -26,9 +26,19 @@ from CimTest import CimExt
from CimTest import CimExt
from CimTest import Globals
from XenKvmLib import assoc
+from XenKvmLib.const import CIM_REV
from XenKvmLib.classes import get_typed_class
-LinkTechnology_Ethernet = 2
+net_rev = 599
+
+# The branch has to be removed once the new rpm
+# including the changes in revision 599 is available.
+# The value of LinkTechnology should be set to 2 for
+# network, bridge and ethernet type interfaces.
+if net_rev > CIM_REV:
+ LinkTechnology_Ethernet = 0
+else:
+ LinkTechnology_Ethernet = 2
class CIM_Instance:
def __init__(self, inst):
16 years, 6 months
[PATCH] [TEST] Fixing 06_paused_active_suspend.py tc of ComputerSystem
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213968570 25200
# Node ID 92675efb0941a25500820ccfde0a7d73d6058acc
# Parent 1837fcafef1281396deb7d03f6754da320af8a36
[TEST] Fixing 06_paused_active_suspend.py tc of ComputerSystem.
1) Included the poll method since the enabledState was not getting set for XenFV appropriately.
2) Included the bugno["0001"], since RequestStateChange() method was not able to suspend a XenFV domain even when it
was in a expected running state.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1837fcafef12 -r 92675efb0941 suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Fri Jun 20 05:58:16 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Fri Jun 20 06:29:30 2008 -0700
@@ -48,7 +48,7 @@ from XenKvmLib.test_doms import destroy_
from XenKvmLib.test_doms import destroy_and_undefine_all
from CimTest.Globals import logger
from CimTest.Globals import do_main
-from XenKvmLib.common_util import call_request_state_change
+from XenKvmLib.common_util import call_request_state_change, get_cs_instance
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
sup_types = ['Xen', 'KVM', 'XenFV']
@@ -56,94 +56,102 @@ mem = 128 # MB
mem = 128 # MB
# Keeping the bug no for future reference
# bug_no_req_change_method = "90559"
+bug_no_req_method = "00001"
bug_no_req_change_prop = "00002"
START_STATE = 2
FINAL_STATE = 9
REQUESTED_STATE = FINAL_STATE
TIME = "00000000000000.000000:000"
-@do_main(sup_types)
-def main():
- options = main.options
+def check_attributes(server, virt, cxml, verify_state):
+ enabledState = RequestedState = None
status = FAIL
-
- cxml = vxml.get_class(options.virt)(test_dom, mem)
-
-#Create VS
- try:
- ret = cxml.create(options.ip)
- if not ret:
- logger.error("ERROR: VS %s was not created" % test_dom)
- return status
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
- if cs.Name == test_dom:
- from_State = cs.EnabledState
- else:
- logger.error("ERROR: VS %s not found" % test_dom)
- return status
- except Exception, detail:
- logger.error("Exception variable: %s" % detail)
- cxml.destroy(options.ip)
- cxml.undefine(options.ip)
- return status
-
-#Suspend the VS
- rc = call_request_state_change(test_dom, options.ip, REQUESTED_STATE,
- TIME, options.virt)
- if rc != 0:
- logger.error("Unable to suspend dom %s using RequestedStateChange()", test_dom)
- cxml.destroy(options.ip)
- cxml.undefine(options.ip)
- return status
-#Polling for the value of EnabledState to be set to 9.
-#We need to wait for the EnabledState to be set appropriately since
-#it does not get set immediatley to value of 9 when suspended.
timeout = 10
try:
-
for i in range(1, (timeout + 1)):
sleep(1)
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
- if cs.Name == test_dom:
- to_RequestedState = cs.RequestedState
- enabledState = cs.EnabledState
- else:
- logger.error("VS %s not found" % test_dom)
- return status
- if enabledState == FINAL_STATE:
+ status, cs = get_cs_instance(test_dom, server, virt)
+ if status != PASS:
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return status, enabledState, RequestedState
+
+ enabledState = cs.EnabledState
+ RequestedState = cs.RequestedState
+
+ if enabledState == verify_state:
status = PASS
break
except Exception, detail:
logger.error("Exception variable: %s" % detail)
- return status
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return status, enabledState, RequestedState
- if enabledState != FINAL_STATE:
- logger.error("EnabledState has %i instead of %i", enabledState, FINAL_STATE)
+ if enabledState != verify_state:
+ logger.error("EnabledState has %i instead of %i", enabledState,
+ verify_state)
logger.error("Try to increase the timeout and run the test again")
if status != PASS:
- ret = cxml.destroy(options.ip)
- cxml.undefine(options.ip)
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return status, enabledState, RequestedState
+
+@do_main(sup_types)
+def main():
+ options = main.options
+ server = options.ip
+ virt = options.virt
+
+ #Create VS
+ cxml = vxml.get_class(virt)(test_dom, mem)
+ ret = cxml.create(server)
+ if not ret:
+ logger.error("ERROR: VS %s was not created" % test_dom)
return status
-# Success:
-# if
-# From state == 9
-# To state == 2
-# Enabled_state == RequestedState
+ status, from_State, req_state = check_attributes(server, virt, cxml,
+ START_STATE)
+ if status != PASS:
+ return status
+
+ #Suspend the VS
+ status = call_request_state_change(test_dom, server, REQUESTED_STATE,
+ TIME, virt)
+ if status != PASS:
+ logger.error("Unable to suspend dom '%s' using RequestedStateChange()",
+ test_dom)
+ cxml.destroy(server)
+ cxml.undefine(server)
+ status = XFAIL_RC(bug_no_req_method)
+ return status
+
+ status, enabledState, to_RequestedState = check_attributes(server,
+ virt, cxml,
+ FINAL_STATE)
+ if status != PASS:
+ return status
+
+ # Success:
+ # if
+ # From state == 9
+ # To state == 2
+ # Enabled_state == RequestedState
if from_State == START_STATE and \
to_RequestedState == FINAL_STATE and \
enabledState == to_RequestedState:
status = PASS
else:
- logger.error("ERROR: VS %s transition from suspend State to Activate state \
- was not Successful" % test_dom)
-# Replace the status with FAIL once the bug is fixed.
+ logger.error("VS '%s' transition from suspend State to Activate "
+ "state was not Successful" % test_dom)
+ # Replace the status with FAIL once the bug is fixed.
status = XFAIL_RC(bug_no_req_change_prop)
- ret = cxml.destroy(options.ip)
- cxml.undefine(options.ip)
+
+ ret = cxml.destroy(server)
+ cxml.undefine(server)
return status
if __name__ == "__main__":
16 years, 6 months
[PATCH] [TEST] Fixing get_cs_instance() of common_util.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213966696 25200
# Node ID 1837fcafef1281396deb7d03f6754da320af8a36
# Parent 1231fad4c1a3b673747df51a8508ff837f0b9686
[TEST] Fixing get_cs_instance() of common_util.py.
1) Initalised cs to None.
2) Modified the return statements in the fn get_cs_instance().
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1231fad4c1a3 -r 1837fcafef12 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Jun 19 23:04:08 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Jun 20 05:58:16 2008 -0700
@@ -46,18 +46,19 @@ def print_field_error(fieldname, ret_val
logger.error("Returned %s instead of %s", ret_value, exp_value)
def get_cs_instance(domain_name, ip, virt='Xen'):
+ cs = None
try:
cs = computersystem.get_cs_class(virt)(ip, domain_name)
if cs.Name != domain_name:
logger.error("VS %s is not found" % domain_name)
- return 1
+ return (1, cs)
except Exception, detail:
logger.error(Globals.CIM_ERROR_GETINSTANCE,
get_typed_class(virt, 'ComputerSystem'))
logger.error("Exception: %s", detail)
- return 1
+ return (1, cs)
return (0, cs)
16 years, 6 months
[PATCH] [TEST] #2 Fixing 40_RSC_start.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213941848 25200
# Node ID 1231fad4c1a3b673747df51a8508ff837f0b9686
# Parent 2384eeff23be0643b12d908640bef054622c6a41
[TEST] #2 Fixing 40_RSC_start.py tc.
Changes in the patch 2:
-----------------------
Modified the debug message.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 2384eeff23be -r 1231fad4c1a3 suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Thu Jun 19 22:49:43 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Thu Jun 19 23:04:08 2008 -0700
@@ -44,6 +44,7 @@ from CimTest.ReturnCodes import PASS, FA
sup_types = ['Xen', 'KVM', 'XenFV']
bug = "00001"
+bug_req_state = "00002"
default_dom = 'test_domain'
REQUESTED_STATE = 2
@@ -52,7 +53,7 @@ def check_attributes(domain_name, ip, vi
def check_attributes(domain_name, ip, virt):
rc, cs = get_cs_instance(domain_name, ip, virt)
if rc != 0:
- return rc
+ return rc
if cs.RequestedState != REQUESTED_STATE:
logger.error("RequestedState should be %d not %d",
@@ -69,30 +70,33 @@ def check_attributes(domain_name, ip, vi
@do_main(sup_types)
def main():
options = main.options
- status = PASS
+ status = FAIL
try:
rc = create_using_definesystem(default_dom, options.ip,
virt=options.virt)
if rc != 0:
- raise Exception("Unable create domain %s using DefineSystem()",
+ raise Exception("DefineSystem() failed to create domain:",
default_dom)
rc = call_request_state_change(default_dom, options.ip,
REQUESTED_STATE, TIME, options.virt)
if rc != 0:
- rc = XFAIL_RC(bug)
- raise Exception("Unable start dom %s using RequestedStateChange()",
- default_dom)
+ status = XFAIL_RC(bug)
+ raise Exception("RequestedStateChange() could not be used to start"
+ " domain: '%s'" %default_dom)
+
rc = check_attributes(default_dom, options.ip, options.virt)
if rc != 0:
- raise Exception("Attributes for %s not set as expected.",
- default_dom)
+ status = XFAIL_RC(bug_req_state)
+ raise Exception("Attributes were not set as expected for "
+ "domain: '%s'" %default_dom)
+ else:
+ status = PASS
except Exception, detail:
logger.error("Exception: %s", detail)
- status = FAIL
undefine_test_domain(default_dom, options.ip, options.virt)
16 years, 6 months
[PATCH] [TEST] Modifying devices.py to fix tc 01_netport.py which was failing on F9 libvirt-cim rpm
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213868143 25200
# Node ID f67381970add8e02ecd3ebbdc600f397c7fa51fe
# Parent 0986ab7af5023cac28da15c59fffcca60c78866c
[TEST] Modifying devices.py to fix tc 01_netport.py which was failing on F9 libvirt-cim rpm.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 0986ab7af502 -r f67381970add suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Thu Jun 19 01:42:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Thu Jun 19 02:35:43 2008 -0700
@@ -26,9 +26,19 @@ from CimTest import CimExt
from CimTest import CimExt
from CimTest import Globals
from XenKvmLib import assoc
+from XenKvmLib.const import CIM_REV
from XenKvmLib.classes import get_typed_class
-LinkTechnology_Ethernet = 2
+net_rev = 598
+
+# The branch has to be removed once the new rpm
+# including the changes in revision 598 is available.
+# The value of LinkTechnology should be set to 2 for
+# network, bridge and ethernet type interfaces.
+if net_rev > CIM_REV:
+ LinkTechnology_Ethernet = 0
+else:
+ LinkTechnology_Ethernet = 2
class CIM_Instance:
def __init__(self, inst):
16 years, 6 months
[PATCH] [TEST] Fixing 40_RSC_start.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213872100 25200
# Node ID aca3e392c2b66f0a50af5c417c819b8e669abd72
# Parent f67381970add8e02ecd3ebbdc600f397c7fa51fe
[TEST] Fixing 40_RSC_start.py tc.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r f67381970add -r aca3e392c2b6 suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Thu Jun 19 02:35:43 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Thu Jun 19 03:41:40 2008 -0700
@@ -44,6 +44,7 @@ from CimTest.ReturnCodes import PASS, FA
sup_types = ['Xen', 'KVM', 'XenFV']
bug = "00001"
+bug_req_state = "00002"
default_dom = 'test_domain'
REQUESTED_STATE = 2
@@ -52,7 +53,7 @@ def check_attributes(domain_name, ip, vi
def check_attributes(domain_name, ip, virt):
rc, cs = get_cs_instance(domain_name, ip, virt)
if rc != 0:
- return rc
+ return rc
if cs.RequestedState != REQUESTED_STATE:
logger.error("RequestedState should be %d not %d",
@@ -69,30 +70,33 @@ def check_attributes(domain_name, ip, vi
@do_main(sup_types)
def main():
options = main.options
- status = PASS
+ status = FAIL
try:
rc = create_using_definesystem(default_dom, options.ip,
virt=options.virt)
if rc != 0:
- raise Exception("Unable create domain %s using DefineSystem()",
+ raise Exception("DefineSystem() failed to create domain:",
default_dom)
rc = call_request_state_change(default_dom, options.ip,
REQUESTED_STATE, TIME, options.virt)
if rc != 0:
- rc = XFAIL_RC(bug)
- raise Exception("Unable start dom %s using RequestedStateChange()",
- default_dom)
+ status = XFAIL_RC(bug)
+ raise Exception("RequestedStateChange() could not be used to start "
+ "domain:", default_dom)
+
rc = check_attributes(default_dom, options.ip, options.virt)
if rc != 0:
- raise Exception("Attributes for %s not set as expected.",
+ status = XFAIL_RC(bug_req_state)
+ raise Exception("Attributes were not set as expected for domain:",
default_dom)
+ else:
+ status = PASS
except Exception, detail:
logger.error("Exception: %s", detail)
- status = FAIL
undefine_test_domain(default_dom, options.ip, options.virt)
16 years, 6 months
[PATCH] [TEST] 3# Update RAFP.01 for LXC support
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1213853486 -28800
# Node ID fdbb6e915f260e05ac2a46d2379a5a1316e10d39
# Parent fc18447de1be94d839fdb1619811c1294bb279f9
[TEST] 3# Update RAFP.01 for LXC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r fc18447de1be -r fdbb6e915f26 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Wed Jun 18 06:00:10 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Thu Jun 19 13:31:26 2008 +0800
@@ -26,68 +26,122 @@
from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.test_doms import destroy_and_undefine_all
+from XenKvmLib.vxml import get_class
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import logger, do_main
+from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \
+create_netpool_conf
from CimTest.ReturnCodes import PASS, FAIL, XFAIL
-sup_types = ['Xen', 'XenFV', 'KVM']
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+test_dom = "RAFP_dom"
+test_vcpus = 1
+test_mem = 128
+test_mac = "00:11:22:33:44:aa"
+
+def setup_env(server, virt):
+ destroy_and_undefine_all(server)
+ vsxml = None
+ if virt == "Xen":
+ test_disk = "xvda"
+ if virt == "XenFV" or virt == "KVM":
+ test_disk = "hda"
+
+ virtxml = get_class(virt)
+ if virt == 'LXC':
+ vsxml = virtxml(test_dom)
+ else:
+ vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus,
+ mac = test_mac, disk = test_disk)
+ try:
+ ret = vsxml.define(server)
+ if not ret:
+ logger.error("Failed to Define the domain: %s", test_dom)
+ return FAIL, vsxml, test_disk
+
+ except Exception, details:
+ logger.error("Exception : %s", details)
+ return FAIL, vsxml, test_disk
+
+ return PASS, vsxml
+
+def get_instance(server, pool, list, virt='Xen'):
+ try:
+ inst = enumclass.getInstance(server,
+ pool,
+ list,
+ virt)
+ except Exception:
+ logger.error(Globals.CIM_ERROR_GETINSTANCE % pool)
+ return FAIL
+
+ return inst
+
+def verify_rasd(server, assoc_cn, cn, virt, list, rasd_id):
+ try:
+ data = assoc.AssociatorNames(server,
+ assoc_cn,
+ cn,
+ virt,
+ InstanceID=list)
+ except Exception:
+ logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % cn)
+ status = FAIL
+
+ if len(data) != 1:
+ logger.error("No associated rasd for %s", cn)
+ return FAIL
+
+ if data[0]['InstanceID'] not in rasd:
+ logger.error("InstanceID Mismatch")
+ logger.error("Returned %s error" % data[0]['InstanceID'])
+ return FAIL
+
+
@do_main(sup_types)
def main():
options = main.options
status = PASS
- try:
- key_list = { 'InstanceID' : "MemoryPool/0" }
- mempool = enumclass.getInstance(options.ip,
- "MemoryPool",
- key_list,
- options.virt)
- except Exception:
- logger.error(Globals.CIM_ERROR_GETINSTANCE % "MemoryPool")
- return FAIL
+ status, vsxml = setup_env(options.ip, options.virt)
+ if status != PASS:
+ return status
+
+ status, diskid = create_diskpool_conf(options.ip, options.virt)
+ if status != PASS:
+ return status
- try:
- key_list = { 'InstanceID' : "ProcessorPool/0" }
- procpool = enumclass.getInstance(options.ip,
- "ProcessorPool",
- key_list,
- options.virt)
- except Exception:
- logger.error(Globals.CIM_ERROR_GETINSTANCE % "ProcessorPool")
- return FAIL
-
- try:
- memdata = assoc.AssociatorNames(options.ip, "ResourceAllocationFromPool",
- "MemoryPool",
- options.virt,
- InstanceID = mempool.InstanceID)
- except Exception:
- logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % mempool.InstanceID)
- status = FAIL
-
- for i in range(len(memdata)):
- if memdata[i].classname != get_typed_class(options.virt, "MemResourceAllocationSettingData"):
- logger.error("ERROR: Association result error")
- status = FAIL
-
- try:
- procdata = assoc.AssociatorNames(options.ip, "ResourceAllocationFromPool",
- "ProcessorPool",
- options.virt,
- InstanceID = procpool.InstanceID)
- except Exception:
- logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % procpool.InstanceID)
- status = FAIL
-
- for j in range(len(procdata)):
- if procdata[j].classname != get_typed_class(options.virt, "ProcResourceAllocationSettingData"):
- logger.error("ERROR: Association result error")
- status = FAIL
+ status, test_network = create_netpool_conf(options.ip, options.virt)
+ if status != PASS:
+ return status
+ global rasd
+ if options.virt == 'LXC':
+ pool = { "MemoryPool" : {'InstanceID' : "MemoryPool/0"} }
+ rasd = [ "%s/mem" % test_dom ]
+ else:
+ pool = { "MemoryPool" : {'InstanceID' : "MemoryPool/0"},
+ "ProcessorPool" : {'InstanceID' : "ProcessorPool/0"},
+ "DiskPool" : {'InstanceID' : diskid},
+ "NetworkPool" : {'InstanceID' : "NetworkPool/%s" % test_network }}
+ rasd = [ "%s/mem" % test_dom,
+ "%s/proc" % test_dom,
+ "%s/%s" %(test_dom, diskid),
+ "%s/%s" % (test_dom, test_network) ]
+
+ for k, v in pool.iteritems():
+ inst = get_instance(options.ip, k, v, options.virt)
+
+ verify_rasd(options.ip, "ResourceAllocationFromPool",
+ k, options.virt, inst.InstanceID,
+ v['InstanceID'])
+
+ cleanup_restore(options.ip, options.virt)
+ vsxml.undefine(options.ip)
return status
-
if __name__ == "__main__":
sys.exit(main())
16 years, 6 months
[PATCH] [TEST] #2 Fixing 03_user_netport.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213864932 25200
# Node ID 0986ab7af5023cac28da15c59fffcca60c78866c
# Parent fc18447de1be94d839fdb1619811c1294bb279f9
[TEST] #2 Fixing 03_user_netport.py tc.
Changes:
-------
>From patch 1 to 2:
------------------
1) Modified the verification of the device.DeviceID from None to devid.
2) Modifed the log message to make it more meaningful.
Patch 1:
-------
1) Changed the return value to XFAIL since the provider does not support guest with user interface type.
2) Fixed the KeyError.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r fc18447de1be -r 0986ab7af502 suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Wed Jun 18 06:00:10 2008 -0700
+++ b/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Thu Jun 19 01:42:12 2008 -0700
@@ -32,18 +32,18 @@ from XenKvmLib.vxml import KVMXML
from XenKvmLib.vxml import KVMXML
from CimTest.Globals import logger
from CimTest.Globals import do_main
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
sup_types = ['KVM']
test_dom = "test_domain"
test_mac = "00:11:22:33:44:55"
+bug = '00004'
@do_main(sup_types)
def main():
options = main.options
- const.KVM_default_net_type = 'user'
- cxml = KVMXML(test_dom, mac = test_mac)
+ cxml = KVMXML(test_dom, mac = test_mac, ntype='user')
ret = cxml.define(options.ip)
if not ret:
logger.error('Unable to define domain %s' % test_dom)
@@ -62,10 +62,11 @@ def main():
except Exception, detail:
logger.error("Exception: %s" % detail)
cxml.undefine(options.ip)
- return FAIL
+ return XFAIL_RC(bug)
- if dev == None:
- logger.error("Error retrieving instance for devid %s" % devid)
+ if dev.DeviceID != devid:
+ logger.error("DeviceID reported incorrectly (%s instead of %s)",
+ dev.DeviceID, devid)
cxml.undefine(options.ip)
return FAIL
16 years, 6 months