[Libvirt-cim] [PATCH] [TEST] Add 10 seconds delay at the beginning of LogicalDisk-02_nodevs.py for Xen/XenFV
Guo Lian Yun
yunguol at cn.ibm.com
Wed Sep 10 07:39:33 UTC 2008
libvirt-cim-bounces at redhat.com wrote on 2008-09-09 23:44:15:
> > 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?
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?
Thanks!
>
> --
> Kaitlin Rupert
> IBM Linux Technology Center
> kaitlin at linux.vnet.ibm.com
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20080910/fdd5c500/attachment-0001.htm>
More information about the Libvirt-cim
mailing list