[PATCH] [TEST] #2 Fixing the 04_defineStartVS.py tc failure

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1207913303 -19800 # Node ID ee931f10e1f0b83d410f8e1c13d320b23bba7f1e # Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50 [TEST] #2 Fixing the 04_defineStartVS.py tc failure. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r 19ff9c851ed8 -r ee931f10e1f0 suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Wed Apr 09 18:00:14 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Fri Apr 11 16:58:23 2008 +0530 @@ -6,6 +6,7 @@ # Kaitlin Rupert <karupert@us.ibm.com> # Veerendra Chandrappa <vechandr@in.ibm.com> # Zhengang Li <lizg@cn.ibm.com> +# Deepti B. kalakeri <deeptik@linux.vnet.ibm.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public @@ -28,10 +29,11 @@ # 10-Oct-2007 import sys +from time import sleep from XenKvmLib import vxml from XenKvmLib import computersystem -from VirtLib import utils from CimTest import Globals +from XenKvmLib.classes import get_typed_class from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL @@ -53,18 +55,22 @@ def main(): Globals.logger.error("Failed to Start the dom: %s", test_dom) cxml.undefine(options.ip) return status + + timeout = 10 + try: + # Need to poll for XenFV, since enabState is not getting set otherwise. + for i in range(1, (timeout + 1)): + sleep(1) + cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) + if cs.Name != test_dom: + Globals.logger.error("VS %s is not defined" % test_dom) + break - try: - cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom) - - if cs.Name == test_dom: + # Success: VS is in Enabled State after Define and Start enabState = cs.EnabledState - else: - Globals.logger.error("VS %s is not defined" % test_dom) - - # Success: VS is in Enabled State after Define and Start - if enabState == 2: - status = PASS + if enabState == 2: + status = PASS + break except Exception, detail: Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE,

+ # Success: VS is in Enabled State after Define and Start
Normally, comments are indented to match the line they precede. So, in this case, You'd want: # Success: VS is in Enabled State after Define and Start if enabState == 2: Instead of: # Success: VS is in Enabled State after Define and Start if enabState == 2: However, I've checked this in since it's minor. Also, I noticed another issue in this test not related to your patch. The exception block returns without destroying/undefining the guest. Could you write a fix for this? -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (2)
-
Deepti B. Kalakeri
-
Kaitlin Rupert