[Libvirt-cim] [PATCH] [TEST]#2 Fix LogicalDisk - 02_nodevs.py

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Sep 11 21:22:44 UTC 2008


yunguol at cn.ibm.com wrote:
> # HG changeset patch
> # User Guolian Yun <yunguol at cn.ibm.com>
> # Date 1221099062 25200
> # Node ID 79fa907586aa87d71277bf887010d103bba8ccae
> # Parent  bc52b5b0cf586ce117ab43dd9cf3e927d711fbaa
> [TEST]#2 Fix LogicalDisk - 02_nodevs.py
> 
> Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>
> 
> diff -r bc52b5b0cf58 -r 79fa907586aa suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py
> --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py	Wed Sep 10 20:10:48 2008 +0530
> +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py	Wed Sep 10 19:11:02 2008 -0700
> @@ -25,6 +25,7 @@
> 
>  import sys
>  import pywbem
> +from time import sleep
>  from VirtLib import live
>  from XenKvmLib import devices
>  from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
> @@ -59,6 +60,15 @@ def main():
> 
>      cn = "LogicalDisk"
> 
> +    timer_count = 10
> +    for count in range(0, 10):
> +        if count < timer_count:
> +            cs = live.domain_list(options.ip, options.virt) 
> +            if len(cs) == 0:
> +                break
> +            sleep(1)
> +            if count == 9 and len(cs) != 0:
> +                return SKIP
>      try:
>          devs = devices.enumerate(options.ip, cn, key_list, options.virt)

You'll want this polling bit to be a part of the clean_system() function 
- this is the check to see if there are guests running on the system.

I'd remove the call to live.domain_list() in clean_system() and use 
enumerate() on the ComputerSystem class.  That way you're getting the 
list of guests the providers are seeing.

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




More information about the Libvirt-cim mailing list