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

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Fri Apr 11 11:28:33 UTC 2008


# HG changeset patch
# User Deepti B. Kalakeri <deeptik at 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 at 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 at us.ibm.com>
 #    Veerendra Chandrappa <vechandr at in.ibm.com>
 #    Zhengang Li <lizg at cn.ibm.com>
+#    Deepti B. kalakeri <deeptik at 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, 




More information about the Libvirt-cim mailing list