[Libvirt-cim] [PATCH 09 of 10] [TEST] Fixing and updating SettingDefine and SystemDevice tc for Association parameter changes

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Fri Oct 3 12:39:17 UTC 2008


# HG changeset patch
# User Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
# Date 1223030236 25200
# Node ID 93041fa7f05b5db0ef3aeb9fbcf072c5d427454f
# Parent  ea47af48530d8cdfe804deb7367e0e586a2df0d7
[TEST] Fixing and updating SettingDefine and SystemDevice tc for Association parameter changes

1) updated 01_forward.py for  Association parameter changes
2) updated 02_reverse.py for  Association parameter changes
   Fixed BaseException, included Exception instead
3) updated SystemDevice 01_forward.py for  Association parameter changes
4) updated SystemDevice 02_reverse.py for  Association parameter changes


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

diff -r ea47af48530d -r 93041fa7f05b suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py	Fri Oct 03 03:16:41 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py	Fri Oct 03 03:37:16 2008 -0700
@@ -111,9 +111,8 @@ def main():
     for cn in logelelst.keys():
         try:
             ccn = get_typed_class(options.virt, cn)
-            assoc_info = assoc.AssociatorNames(options.ip, 
-                                               'SettingsDefineState',
-                                               cn, virt=options.virt,
+            an = get_typed_class(options.virt, 'SettingsDefineState')
+            assoc_info = assoc.AssociatorNames(options.ip, an, ccn, 
                                                DeviceID = logelelst[cn],
                                                CreationClassName = ccn,
                                                SystemName = test_dom,
diff -r ea47af48530d -r 93041fa7f05b suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py	Fri Oct 03 03:16:41 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py	Fri Oct 03 03:37:16 2008 -0700
@@ -74,10 +74,10 @@ def call_assoc(ip, inst, exp_id, ccn, vi
         return FAIL
 
     try:
-        associnf = assoc.Associators(ip, 'SettingsDefineState',
-                                     ccn, virt,
-                                     InstanceID = exp_id)
-    except  BaseException, detail :
+        an = get_typed_class(virt, 'SettingsDefineState')
+        ccn = get_typed_class(virt, ccn)
+        associnf = assoc.Associators(ip, an, ccn, InstanceID = exp_id)
+    except  Exception, detail :
         logger.error("Exception  %s "  % detail)
         logger.error("Error while associating Xen_SettingsDefineState with %s" %
                      ccn)
@@ -108,7 +108,7 @@ def VSSDCAssoc(ip, assocn, virt):
                 logger.error("Mistmatching value for VSSDComponent association")
                 break  
 
-    except  BaseException, detail :
+    except  Exception, detail :
         logger.error("Exception in VSSDCAssoc function: %s" % detail)
         status = FAIL
 
@@ -142,7 +142,7 @@ def SettingsDefineStateAssoc(ip, associn
                 logger.error("Mistmatching value for SettingsDefineState assoc")
                 break  
 
-    except  BaseException, detail :
+    except  Exception, detail :
         logger.error("Exception in SettingsDefineStateAssoc function: %s" 
                      % detail)
         status = FAIL
@@ -201,12 +201,11 @@ def main():
 
     try:
         assocn = assoc.AssociatorNames(options.ip, vssdc_cn, vssd_cn,
-                                       virt = options.virt,
                                        InstanceID = instIdval)
             
         status = VSSDCAssoc(options.ip, assocn, options.virt)
 
-    except  BaseException, detail :
+    except  Exception, detail :
         logger.error(Globals.CIM_ERROR_ASSOCIATORS, vssdc_cn)
         logger.error("Exception : %s" % detail)
         status = FAIL 
diff -r ea47af48530d -r 93041fa7f05b suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py	Fri Oct 03 03:16:41 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py	Fri Oct 03 03:37:16 2008 -0700
@@ -64,7 +64,6 @@ def main():
     cs_classname = get_typed_class(options.virt, 'ComputerSystem')
 
     devs = assoc.AssociatorNames(options.ip, sd_classname, cs_classname,
-                                 virt=options.virt,
                                  Name=test_dom, CreationClassName=cs_classname)
     if devs == None:
         logger.error("System association failed")
diff -r ea47af48530d -r 93041fa7f05b suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py	Fri Oct 03 03:16:41 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py	Fri Oct 03 03:37:16 2008 -0700
@@ -33,6 +33,7 @@ from CimTest.Globals import logger
 from CimTest.Globals import logger
 from XenKvmLib.const import do_main
 from CimTest.ReturnCodes import PASS, FAIL 
+from XenKvmLib.common_util import get_typed_class
 
 sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
 
@@ -70,12 +71,13 @@ def main():
                 continue
 
             try:
-                systems = assoc.AssociatorNames(options.ip,
-                                "SystemDevice", items, virt=options.virt,
-                                DeviceID=dev.DeviceID,
-                                CreationClassName=dev.CreationClassName,
-                                SystemName=dev.SystemName,
-                                SystemCreationClassName=dev.SystemCreationClassName)
+                an = get_typed_class(options.virt, "SystemDevice")
+                cn = dev.CreationClassName
+                systems = assoc.AssociatorNames(options.ip, an, cn, 
+                                                DeviceID=dev.DeviceID,
+                                                CreationClassName=cn,
+                                                SystemName=dev.SystemName,
+                                                SystemCreationClassName=dev.SystemCreationClassName)
             except Exception, detail:
                 logger.error("Exception: %s" % detail)
                 cxml.destroy(options.ip)




More information about the Libvirt-cim mailing list