[Libvirt-cim] [PATCH] [TEST] Updating enumclass.py library and Rebasing, Fixing and updating ElementCapabilities tc to work with and without sblim-base-provider

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Oct 6 21:51:43 UTC 2008


> -        logger.error("ElementCapabilities association failed, excepted at least one instance")
> -        return FAIL
> +        logger.error("'%s' association failed, excepted at least one instance",
> +                     an)

I know this is an existing issue, but there's a typo.. can you change 
"excepted" to "expected".

> +    virtxml = vxml.get_class(virt)
> +    cxml = virtxml(test_dom)
> +    ret = cxml.cim_define(server)
> +    if not ret:
> +        logger.error("Failed to define the dom: %s", test_dom)
> +        status = FAIL
> +        return status

Can just have "return FAIL" here.

> 
>  if __name__ == "__main__":
> diff -r b710ecb26adf -r 13af302129be suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py
> --- a/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py	Fri Oct 03 06:34:29 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py	Mon Oct 06 03:42:28 2008 -0700
> @@ -26,26 +26,30 @@
>  from VirtLib import live
>  from XenKvmLib import assoc
>  from XenKvmLib import enumclass
> -from XenKvmLib import vsms
> -from XenKvmLib.classes import get_typed_class 
> -from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORNAMES
> +from XenKvmLib import vxml
> +from XenKvmLib.classes import get_typed_class
> +from XenKvmLib.classes import get_class_basename
> +from XenKvmLib.common_util import get_host_info
> +from CimTest.Globals import logger, CIM_ERROR_GETINSTANCE, \
> +CIM_ERROR_ASSOCIATORNAMES

Can you indent this so it's lined up under "logger"?  Make the import 
block a little easier to read.

> +def verify_service(inst_list, ip, virt, host_name, host_ccn,
> +                   name=" ", ser_cn=""):

There probably won't be a type where you won't pass in values for name 
and ser_cn.  So I'd change this to:

def verify_service(inst_list, ip, virt, host_name, host_ccn,
                    name, ser_cn):

This makes it so that you can call verify_service() without having to 
specify name="foo", ser_cn="bar".

> +
> +    virtxml = vxml.get_class(options.virt)
> +    cxml = virtxml(test_dom)
> +    ret = cxml.cim_define(options.ip)
> +    if not ret:
> +        logger.error("Failed to define the dom: %s" % test_dom)
> +        return FAIL
> 
>      cs = live.domain_list(options.ip, options.virt)
>      for system in cs:
> -        status, elec_cs = call_assoc(options.ip, 
> -                                     "EnabledLogicalElementCapabilities", 
> -                                     system,
> -                                     options.virt)
> +        cn = get_typed_class(options.virt, "EnabledLogicalElementCapabilities")
> +        status, elec_cs = call_assoc(options.ip, cn, system, options.virt)
>          if status != PASS:
> -            return
> +            return FAIL

You'll need to undefine the domain before the return.

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




More information about the Libvirt-cim mailing list