[Libvirt-cim] [PATCH] [TEST] Remove XFAIL from EC 01 and 02

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Dec 9 22:03:20 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1228859898 28800
# Node ID 84313e6c8f504da2416bd3bdcc7195e3c51a5a6d
# Parent  f72029b3c3e50bbadeabb9023ae8dd2175f7e89b
[TEST] Remove XFAIL from EC 01 and 02.

Fixed 01:
Update to work with CRS.

Also update the logic so that items aren't removed from the managed_ele list
when a match is properly found.  It's possible for multiple profiles to return
the same managed element, so removing the elements from this list would cause
a false failure.

Instead, maintain a found list.  If a managed element isn't in the found list,
return an error.

Fixed 02:
Fixed to work with SBLIM host instance as well as libvirt-cim host instance.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r f72029b3c3e5 -r 84313e6c8f50 suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py	Mon Dec 08 14:21:00 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py	Tue Dec 09 13:58:18 2008 -0800
@@ -46,15 +46,16 @@
 from XenKvmLib.common_util import print_field_error, get_host_info 
 from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
 from XenKvmLib.const import do_main, get_provider_version 
-from CimTest.ReturnCodes import PASS, FAIL, XFAIL, XFAIL_RC
+from CimTest.ReturnCodes import PASS, FAIL
 from XenKvmLib.enumclass import EnumInstances
 
 sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
 test_dom = "domU"
 bug_sblim = '00007'
 libvirt_cim_ectp_changes = 686
+libvirt_cim_input_graphics_ectp = 773 
 
-def  init_vs_pool_values(server, virt):
+def  init_managed_ele_values(server, virt):
     verify_ectp_list = {} 
 
     cn_names = ["ComputerSystem"]
@@ -64,6 +65,8 @@
         cn_names2 = ["VirtualSystemMigrationService", "DiskPool", "NetworkPool",
                      "ProcessorPool", "MemoryPool"]
         cn_names.extend(cn_names2)
+    if curr_cim_rev >= libvirt_cim_input_graphics_ectp:
+        cn_names.append("ConsoleRedirectionService")
 
     status, host_inst = get_host_info(server, virt)
     if status != PASS:
@@ -91,15 +94,14 @@
 
         for ele in elements:
             if assoc_val.items() == ele.items():
-                managed_ele_values[cn].remove(ele)
-                return PASS, managed_ele_values
+                return PASS
 
     except Exception, details:
         logger.error("verify_fields() exception: %s", details)
-        return FAIL, managed_ele_values
+        return FAIL
       
     logger.error("%s not in expected list %s", assoc_val, elements)
-    return FAIL, managed_ele_values
+    return FAIL
 
 def get_proflist(server, reg_classname, virt):
     profiles_instid_list = []
@@ -162,7 +164,7 @@
     verify_ectp_list = {} 
 
     try:
-        status, verify_ectp_list = init_vs_pool_values(server, virt)
+        status, verify_ectp_list = init_managed_ele_values(server, virt)
         if status != PASS:
             raise Exception("Failed to get instances needed for verification") 
 
@@ -175,6 +177,7 @@
         if status != PASS:
             raise Exception("Failed to get profile list") 
 
+        found = []
         for prof_id in prof_inst_lst:
             logger.info("Verifying '%s' with '%s'", an, prof_id)
             assoc_info = assoc.Associators(server,
@@ -187,15 +190,15 @@
                                 (an, len(assoc_info), reg_classname))
 
             for inst in assoc_info:
-                status, verify_ectp_list = verify_fields(inst, verify_ectp_list)
+                status = verify_fields(inst, verify_ectp_list)
                 if status != PASS:
                     raise Exception("Failed to verify instance") 
+                found.append(inst.classname)
 
-        if status == PASS:
-            for k, l in verify_ectp_list.iteritems():
-                if len(l) != 0:
-                    status = FAIL
-                    raise Exception("%s items weren't returned: %s" % (k, l))
+        for key, list in verify_ectp_list.iteritems():
+            if key not in found:
+                status = FAIL
+                raise Exception("%s items weren't returned: %s" % (key, list))
 
     except Exception, detail:
         logger.error("Exception: %s" % detail)
@@ -205,9 +208,6 @@
     cxml.destroy(server)
     cxml.undefine(server)
 
-    if "Linux_ComputerSystem" in verify_ectp_list:
-        return XFAIL_RC(bug_sblim)
-    
     return status
 
 if __name__ == "__main__":
diff -r f72029b3c3e5 -r 84313e6c8f50 suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py	Mon Dec 08 14:21:00 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py	Tue Dec 09 13:58:18 2008 -0800
@@ -49,7 +49,7 @@
 from XenKvmLib import enumclass
 from XenKvmLib.vxml import XenXML, KVMXML, get_class
 from XenKvmLib.classes import get_typed_class
-from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+from CimTest.ReturnCodes import PASS, FAIL
 from XenKvmLib.common_util import libvirt_cached_data_poll, get_cs_instance, \
                                   get_host_info
 
@@ -58,14 +58,14 @@
 test_dom  ="domgst"
 bug_sblim ='00007'
 
-def build_exp_prof_list(proflist, virt="Xen"):
+def build_exp_prof_list(proflist, virt, host_inst):
     list = {} 
     
     for item in proflist:
         if item.InstanceID.find('-VirtualSystem-') >= 0:
             list[get_typed_class(virt, 'ComputerSystem')] = item 
         elif item.InstanceID.find('-SystemVirtualization-') >= 0:
-            list[get_typed_class(virt, 'HostSystem')] = item 
+            list[host_inst.CreationClassName] = item 
 
     return list
 
@@ -115,7 +115,6 @@
             cxml.undefine(server)
             return status
 
-
     except Exception, details:
         logger.error("DEBUG Exception: %s" % details)
         cxml.undefine(server)
@@ -137,7 +136,7 @@
 
     Globals.CIM_NS = prev_namespace
 
-    exp_list = build_exp_prof_list(proflist, virt)
+    exp_list = build_exp_prof_list(proflist, virt, host_inst)
 
     # Loop through the assoc results returned on test_dom and hostsystem 
     try:
@@ -149,7 +148,7 @@
                                       cn,
                                       CreationClassName=cn,
                                       Name=name)
-            if len(profs) != 1:
+            if len(profs) < 1:
                 if cn == 'Linux_ComputerSystem':
                     status = XFAIL_RC(bug_sblim)
                 else:   




More information about the Libvirt-cim mailing list