[Libvirt-cim] [PATCH] [TEST] #3 XFAIL for the 'VirtualQuantity' verification when the guest is runing
Deepti B Kalakeri
deeptik at linux.vnet.ibm.com
Thu Mar 5 09:59:59 UTC 2009
yunguol at cn.ibm.com wrote:
> # HG changeset patch
> # User Guolian Yun <yunguol at cn.ibm.com>
> # Date 1236230756 28800
> # Node ID d0186caa78d2a8614d6c82b6e4413125b50e4953
> # Parent c6f7256013b97dc57a31312897e45eb3cd8604a7
> [TEST] #3 XFAIL for the 'VirtualQuantity' verification when the guest is runing
>
>
> 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 at cn.ibm.com>
>
> diff -r c6f7256013b9 -r d0186caa78d2 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 Wed Mar 04 21:25:56 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 == FAIL and virt != 'KVM':
> raise Exception("CPU scheduling not set properly for the dom: "
> "%s" % test_dom)
> + elif status == XFAIL_RC(libvirt_bug) and virt == 'KVM':
>
You dont have to call the XFAIL_RC() once again.
This will print the bug no twice which is not incorrect but this is not
useful and required.
You can instead verify the status != PASS here.
> + break
>
> cxml.cim_destroy(server)
> dom_start = False
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list