[Libvirt-cim] [PATCH] [TEST] Fixing 04_defineStartVS.py tc

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Mon Apr 14 07:27:38 UTC 2008


# HG changeset patch
# User Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
# Date 1208157938 -19800
# Node ID f622bcacdd160dd9bd1ad5f1c7cbbc8101aabbbc
# Parent  137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2
[TEST] Fixing 04_defineStartVS.py tc.

Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>

diff -r 137e5079c73f -r f622bcacdd16 suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py	Fri Apr 11 16:58:23 2008 +0530
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py	Mon Apr 14 12:55:38 2008 +0530
@@ -26,7 +26,8 @@
 # This test case checks state of the VS is in enabled state after 
 # defining and starting the  VS.
 # By verifying the properties of EnabledState = 2 of the VS.
-# 10-Oct-2007
+#                               
+#                                                             10-Oct-2007
 
 import sys
 from time import sleep
@@ -58,15 +59,17 @@ def main():
     
     timeout = 10
     try:
-    # Need to poll for XenFV, since enabState is not getting set otherwise. 
+        # 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)
+            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  
 
-    # Success: VS is in Enabled State after Define and Start 
+            # Success: VS is in Enabled State after Define and Start 
             enabState = cs.EnabledState
             if enabState == 2:
                 status = PASS
@@ -76,10 +79,13 @@ def main():
         Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE, 
                              get_typed_class(options.virt, 'ComputerSystem'))
         Globals.logger.error("Exception: %s", detail)
-        return status
+        cxml.destroy(options.ip)
+        cxml.undefine(options.ip)
+        return status 
 
     if status != PASS :
-        Globals.logger.error("Error: property values are not set for VS %s" , test_dom)
+        Globals.logger.error("Error: property values are not set for VS %s", 
+                                                                   test_dom)
 
     cxml.destroy(options.ip)
     cxml.undefine(options.ip)




More information about the Libvirt-cim mailing list