[Libvirt-cim] [PATCH] [TEST]#2 Update tests to meet 80-char width limit

yunguol at cn.ibm.com yunguol at cn.ibm.com
Tue Feb 10 05:47:42 UTC 2009


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1234244855 28800
# Node ID 1bb347c22e6ed03032f359c8c28e59e94b7316c2
# Parent  263e285881acde9b99849cd133399298219c9d65
[TEST]#2 Update tests to meet 80-char width limit

Updates form 1 to 2:
Fix line 67 in ResourceAllocationFromPool/03_forward_errs.py
Fix  lines 45 - 48 in ResourceAllocationFromPool/04_reverse_errs.py
Fix line 56 in VirtualSystemMigrationSettingData/01_enum.py
Fix lines 58 and 63 in VirtualSystemSnapshotService/01_enum.py

1) Split lines to 80-char width limit

Tested for KVM/LXC with current sources

Signed-off-by: Guolian Yun<yunguol at cn.ibm.com>

diff -r 263e285881ac -r 1bb347c22e6e suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py	Fri Feb 06 01:54:39 2009 -0800
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py	Mon Feb 09 21:47:35 2009 -0800
@@ -55,17 +55,18 @@
         instanceref = CIMInstanceName(k, 
                                       keybindings = {"InstanceID" : v})
         names = []
-
+        rafp = get_typed_class(options.virt, "ResourceAllocationFromPool")
         try:
             names = conn.AssociatorNames(instanceref, 
-                                         AssocClass = get_typed_class(options.virt, "ResourceAllocationFromPool"))
+                                         AssocClass = rafp)
             rc = 0
         except pywbem.CIMError, (rc, desc):
             if rc == exp_rc and desc.find(exp_desc) >= 0:
                 logger.info("Got excepted rc code and error string")
                 status = PASS
             else:
-                logger.error("Unexpected rc code %s and description %s\n", rc, desc)
+                logger.error("Unexpected rc code %s and description %s\n", 
+                             rc, desc)
         except Exception, details:
             logger.error("Unknown exception happened")
             logger.error(details)
diff -r 263e285881ac -r 1bb347c22e6e suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py	Fri Feb 06 01:54:39 2009 -0800
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py	Mon Feb 09 21:47:35 2009 -0800
@@ -41,11 +41,14 @@
     rc = -1
     status = FAIL
 
-
-    dataset = {get_typed_class(options.virt, "MemResourceAllocationSettingData") : "wrong", 
-               get_typed_class(options.virt, "ProcResourceAllocationSettingData") : "wrong",
-               get_typed_class(options.virt, "DiskResourceAllocationSettingData") : "wrong",
-               get_typed_class(options.virt, "NetResourceAllocationSettingData") : "wrong"}
+    mrasd = get_typed_class(options.virt, "MemResourceAllocationSettingData")
+    prasd = get_typed_class(options.virt, "ProcResourceAllocationSettingData")
+    drasd = get_typed_class(options.virt, "DiskResourceAllocationSettingData")
+    nrasd = get_typed_class(options.virt, "NetResourceAllocationSettingData")
+    dataset = {mrasd : "wrong", 
+               prasd : "wrong",
+               drasd : "wrong",
+               nrasd : "wrong"}
     conn = assoc.myWBEMConnection('http://%s' % options.ip,                                        
                                   (Globals.CIM_USER, Globals.CIM_PASS),
                                   Globals.CIM_NS)
@@ -53,10 +56,10 @@
         instanceref = CIMInstanceName(k, 
                                       keybindings = {"InstanceID" : v})
         names = []
-
+        rafp = get_typed_class(options.virt, "ResourceAllocationFromPool")
         try:
             names = conn.AssociatorNames(instanceref, 
-                                         AssocClass = get_typed_class(options.virt, "ResourceAllocationFromPool"))
+                                         AssocClass = rafp)
             rc = 0
         except pywbem.CIMError, (rc, desc):
             if rc == exp_rc and desc.find(exp_desc) >= 0:
diff -r 263e285881ac -r 1bb347c22e6e suites/libvirt-cim/cimtest/VirtualSystemMigrationSettingData/01_enum.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationSettingData/01_enum.py	Fri Feb 06 01:54:39 2009 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationSettingData/01_enum.py	Mon Feb 09 21:47:35 2009 -0800
@@ -39,7 +39,8 @@
 def main():
     options = main.options
     # Expected results from enumeration
-    cn       =  get_typed_class(options.virt, "VirtualSystemMigrationSettingData")
+    cn       =  get_typed_class(options.virt, 
+                                "VirtualSystemMigrationSettingData")
     instid   = 'MigrationSettingData'
     MType    = 2 #[CIM_MIGRATE_LIVE]
     priority = 0 
@@ -52,7 +53,8 @@
         return FAIL
 
     if len(vsmsd) != 1:
-        logger.error("%s return %i instances, excepted only 1 instance", cn, len(vsmsd))
+        logger.error("%s return %i instances, excepted only 1 instance", 
+                     cn, len(vsmsd))
         return FAIL
     verify_vsmsd = vsmsd[0]
     if verify_vsmsd.classname != cn:
diff -r 263e285881ac -r 1bb347c22e6e suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py	Fri Feb 06 01:54:39 2009 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSnapshotService/01_enum.py	Mon Feb 09 21:47:35 2009 -0800
@@ -55,12 +55,14 @@
         return FAIL
 
     if len(vs_sservice) != 1:
-        logger.error("%s return %i instances, excepted only 1 instance", cn, len(vs_sservice))
+        logger.error("%s return %i instances, excepted only 1 instance", 
+                     cn, len(vs_sservice))
         return FAIL
     verify_vs_sservice = vs_sservice[0]
 
     if verify_vs_sservice['CreationClassName'] != cn:
-        print_error('CreationClassName', verify_vs_sservice['CreationClassName'], cn)
+        print_error('CreationClassName', 
+                    verify_vs_sservice['CreationClassName'], cn)
         return FAIL
 
     if verify_vs_sservice['Name'] != Name:
@@ -72,7 +74,8 @@
         return FAIL
 
     if verify_vs_sservice['SystemCreationClassName'] != classname:
-        print_error('SystemCreationClassName', verify_vs_sservice['SystemCreationClassName'], classname)
+        print_error('SystemCreationClassName', 
+                    verify_vs_sservice['SystemCreationClassName'], classname)
         return FAIL
 
     return PASS




More information about the Libvirt-cim mailing list