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

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1220941374 25200 # Node ID 25c48331735e8975a715ba3464d38e9f21f9be12 # Parent 8abcd820b6b37e5fbe8ccc30734cefa908dfab78 [TEST] Add 10 seconds delay at the beginning of LogicalDisk-02_nodevs.py for Xen/XenFV Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> 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"]

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@linux.vnet.ibm.com

libvirt-cim-bounces@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@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

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@linux.vnet.ibm.com

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
libvirt-cim-bounces@redhat.com wrote on 2008-09-11 04:46:16: 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.
Done. Patch on the way.
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
participants (3)
-
Guo Lian Yun
-
Kaitlin Rupert
-
yunguol@cn.ibm.com