[Libvirt-cim] [PATCH] [TEST] #7 Add new test to verify enum of DiskRASD to have EmulatedType=0 for Disk and EmulatedType=1 for CDROM

Deepti B Kalakeri deeptik at linux.vnet.ibm.com
Tue Jan 6 06:02:48 UTC 2009



yunguol at cn.ibm.com wrote:
> # HG changeset patch
> # User Guolian Yun <yunguol at cn.ibm.com>
> # Date 1231210158 28800
> # Node ID b592961ccaac67ad3cfd8876beb22beec0c28492
> # Parent  64b84ef28b22d17dd22027c632a9dc44d642d2b5
> [TEST] #7 Add new test to verify enum of DiskRASD to have EmulatedType=0 for Disk and EmulatedType=1 for CDROM
>
> Updates form 6 to 7:
> Correct exception description
>
> Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>
>
> diff -r 64b84ef28b22 -r b592961ccaac suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py	Mon Jan 05 18:49:18 2009 -0800
> @@ -0,0 +1,88 @@
> +#!/usr/bin/python
> +#
> +# Copyright 2008 IBM Corp.
> +#
> +# Authors:
> +#    Guolian Yun <yunguol at cn.ibm.com>
> +#
> +# This library is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public
> +# License as published by the Free Software Foundation; either
> +# version 2.1 of the License, or (at your option) any later version.
> +#
> +# This library is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public
> +# License along with this library; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
> +#
> +
> +import sys
> +from XenKvmLib.enumclass import EnumInstances
> +from XenKvmLib.classes import get_typed_class
> +from XenKvmLib.common_util import parse_instance_id
> +from XenKvmLib.const import do_main
> +from XenKvmLib.vxml import get_class
> +from CimTest.ReturnCodes import PASS, FAIL
> +from CimTest.Globals import logger
> +from XenKvmLib.const import get_provider_version
> +
> +SUPPORTED_TYPES = ['KVM']
> +default_dom = 'test_domain'
> +libvirt_em_type_changeset = 737
> +
> + at do_main(SUPPORTED_TYPES)
> +def main():
> +    status = FAIL
> +    options = main.options
> +    curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
> +    if curr_cim_rev < libvirt_em_type_changeset:
> +        return SKIP
> +
> +    emu_types = [0, 1]
> +    try:
> +        for exp_emu_type in emu_types:
> +            cxml = get_class(options.virt)(default_dom, emu_type=exp_emu_type)
> +            ret = cxml.cim_define(options.ip)
> +            if not ret:
> +                logger.error("Failed to call DefineSystem()")
> +                return FAIL
> +    
> +            drasd= get_typed_class(options.virt,'DiskResourceAllocationSettingData')
> +        
> +            drasd_list = EnumInstances(options.ip, drasd, ret_cim_inst=True)
>   
Are you planning to change the EnumInstance to GetInstance() ?? Or is 
this final changes for the test case ?

Thanks and Regards,
Deepti.




More information about the Libvirt-cim mailing list