[Libvirt-cim] [PATCH 4 of 5] [TEST] #3 Add new tc to verify the DeleteResourceInPool()

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Sep 17 00:50:46 UTC 2009


> +import sys
> +from CimTest.Globals import logger
> +from CimTest.ReturnCodes import FAIL, PASS, SKIP
> +from XenKvmLib.xm_virt_util import virsh_version
> +from XenKvmLib.const import do_main, platform_sup, get_provider_version
> +from XenKvmLib import rpcs_service
> +from XenKvmLib.classes import get_typed_class, inst_to_mof
> +from XenKvmLib.pool import create_pool, DIR_POOL, \
> +                           libvirt_rasd_spool_del_changes, get_diskpool, \
> +                           get_stovol_default_settings, cleanup_pool_vol,\
> +                           get_sto_vol_rasd_for_pool
> +
> +pool_attr = { 'Path' : "/tmp" }
> +vol_name = "cimtest-vol.img"
> +
> + at do_main(platform_sup)
> +def main():
> +    options = main.options
> +    server = options.ip
> +    virt = options.virt
> +
> +    libvirt_ver = virsh_version(server, virt)
> +    cim_rev, changeset = get_provider_version(virt, server)
> +    if libvirt_ver < "0.4.1" and cim_rev < libvirt_rasd_spool_del_changes:
> +        logger.info("Storage Volume deletion support is available with Libvirt"
> +                    "version >= 0.4.1 and Libvirt-CIM rev '%s'", 
> +                    libvirt_rasd_spool_del_changes)
> +        return SKIP
> +
> +    dp_cn = "DiskPool"
> +    exp_vol_path = "%s/%s" % (pool_attr['Path'], vol_name)

I think this test suffers from the same problem 10 does.  The path for 
your volume is "/tmp/cimtest-vol.img" but you want to create it in 
DIR_POOL.  So I think you have a mismatch here.

In that case, you don't even need to create a new pool - just create the 
volume in the default pool and then clean it up when the test exits.

How about holding off on submitting this test until 10 is fixed correctly?

> +
> +    # For now the test case support only the deletion of dir type based 
> +    # vol, we can extend dp_types to include netfs etc .....
> +    dp_types = { "DISK_POOL_DIR" : DIR_POOL }
> +
> +    for pool_name, pool_type in dp_types.iteritems():    
> +        status = FAIL     
> +        res = del_res = [FAIL]
> +        try:
> +            status = create_pool(server, virt, pool_name, pool_attr, 
> +                                 mode_type=pool_type, pool_type=dp_cn)
> +

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list