[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
Wed Sep 10 20:46:16 UTC 2008


>  >
>  > 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?
> 
>   Agree with you.
>   If there is still define guest on the system after waiting for
>   10 seconds, then shall we have to make the timer_count longer?
> 

The problem here is that it's possible the user has other defined guests 
in the system.  So we can't keep polling for there to be no guests.  The 
best we can do is poll for a given amount of time.  If the system still 
has guests on it after the timer is up, then we need to skip the test.

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




More information about the Libvirt-cim mailing list