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

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1221099062 25200 # Node ID 79fa907586aa87d71277bf887010d103bba8ccae # Parent bc52b5b0cf586ce117ab43dd9cf3e927d711fbaa [TEST]#2 Fix LogicalDisk - 02_nodevs.py Signed-off-by: Guolian Yun <yunguol@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)

yunguol@cn.ibm.com wrote:
# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1221099062 25200 # Node ID 79fa907586aa87d71277bf887010d103bba8ccae # Parent bc52b5b0cf586ce117ab43dd9cf3e927d711fbaa [TEST]#2 Fix LogicalDisk - 02_nodevs.py
Signed-off-by: Guolian Yun <yunguol@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@linux.vnet.ibm.com

yunguol@cn.ibm.com wrote:
# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1221099062 25200 # Node ID 79fa907586aa87d71277bf887010d103bba8ccae # Parent bc52b5b0cf586ce117ab43dd9cf3e927d711fbaa [TEST]#2 Fix LogicalDisk - 02_nodevs.py
Signed-off-by: Guolian Yun <yunguol@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,
libvirt-cim-bounces@redhat.com wrote on 2008-09-12 05:22:44: 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.
Good catch! Please review #3 patch.
-- 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