[Libvirt-cim] [PATCH] [TEST] Add 10 seconds delay at the beginning of LogicalDisk-02_nodevs.py for Xen/XenFV

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Sep 9 15:44:15 UTC 2008


> diff -r 8abcd820b6b3 -r 25c48331735e suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py
> --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py	Fri Sep 05 02:47:24 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py	Mon Sep 08 23:22:54 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
> @@ -53,7 +54,8 @@ def main():
>      if not clean_system(options.ip, options.virt):
>          logger.error("System has defined domains; unable to run")
>          return SKIP
> -
> +    if options.virt == 'Xen' or options.virt == 'XenFV':
> +        sleep(10)
>      key_list = ["DeviceID", "CreationClassName", "SystemName", 
>                  "SystemCreationClassName"]

I gave them some more thought.. adding an arbitrary sleep in a test 
isn't really a good idea - because systems run at varying speeds, so you 
can't guarantee how long you'll need to sleep.

A better approach would be to poll to see if there are no guests... if 
there are no guests defined, then run the test, otherwise keep polling. 
  You could poll for 10 seconds or so.  So something like:

timer_count = 10

if count < timer_count:
   #Get list of defined/active guests on the system
   #If no guests are defined
       break
   sleep(1)

Does this sound reasonable?

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




More information about the Libvirt-cim mailing list