# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1236319479 28800
# Node ID ccc6d44875c2e2a961074b92a5165188179481db
# Parent c6f7256013b97dc57a31312897e45eb3cd8604a7
[TEST] #4 XFAIL for the 'VirtualQuantity' verification when the guest is runing
Updates from 3 to 4:
Change if statement for KVM
Updates from 2 to 3:
Break out of the loop when I detect the XFAIL for the first time itself
Updates from 1 to 2:
This issue only hit for KVM, check for the virt type before determining what return.
Tested for KVM with current sources and rpm
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com>
diff -r c6f7256013b9 -r ccc6d44875c2
suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Tue
Mar 03 08:47:40 2009 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Thu
Mar 05 22:04:39 2009 -0800
@@ -42,9 +42,10 @@
from XenKvmLib.classes import get_typed_class, inst_to_mof
from CimTest.Globals import logger
from XenKvmLib.const import do_main
-from CimTest.ReturnCodes import FAIL, PASS
+from CimTest.ReturnCodes import FAIL, PASS, XFAIL_RC
from XenKvmLib.rasd import get_default_rasds
+libvirt_bug = '00013'
sup_types = ['Xen', 'XenFV', 'KVM']
test_dom = 'procrasd_persist_dom'
@@ -76,7 +77,7 @@
return PASS
-def check_proc_sched(server, cn_name):
+def check_proc_sched(server, virt, cn_name):
try:
proc_rasd = None
rasds = EnumInstances(server, cn_name, ret_cim_inst=True)
@@ -89,10 +90,12 @@
logger.error("Did not find test RASD on server")
return FAIL
- if proc_rasd["VirtualQuantity"] != nvcpu:
+ if proc_rasd["VirtualQuantity"] != nvcpu and virt != 'KVM':
logger.error("VirtualQuantity is %i, expected %i",
proc_rasd["VirtualQuantity"], nvcpu)
return FAIL
+ elif proc_rasd["VirtualQuantity"] != nvcpu and virt ==
"KVM":
+ return XFAIL_RC(libvirt_bug)
if proc_rasd["Limit"] != limit:
logger.error("Limit is %i, expected %i",
@@ -126,7 +129,7 @@
return status
dom_define = True
- status = check_proc_sched(server, prasd_cn)
+ status = check_proc_sched(server, virt, prasd_cn)
if status != PASS:
raise Exception("CPU scheduling not set properly for "
" defined dom: %s" % test_dom)
@@ -136,10 +139,12 @@
raise Exception("Unable to start %s " % test_dom)
dom_start = True
- status = check_proc_sched(server, prasd_cn)
- if status != PASS:
+ status = check_proc_sched(server, virt, prasd_cn)
+ if status != PASS and virt != 'KVM':
raise Exception("CPU scheduling not set properly for the dom:
"
"%s" % test_dom)
+ elif status != PASS and virt == 'KVM':
+ break
cxml.cim_destroy(server)
dom_start = False
@@ -156,7 +161,7 @@
if dom_define == True:
cxml.undefine(server)
-
+
return status
if __name__ == "__main__":