[Libvirt-cim] [PATCH 7 of 9] [TEST] Update ElementCapabilties tests to expect instance from get_host_info()

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Nov 17 21:10:34 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1226705452 28800
# Node ID 8d5eb7acc2dab6eda1fb15bf695bae4a090a5816
# Parent  5f39bb761dcb4526e8b43fb6a89a3a7e61589fb1
[TEST] Update ElementCapabilties tests to expect instance from get_host_info().

Also remove XFAILs as these tests should pass now.

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

diff -r 5f39bb761dcb -r 8d5eb7acc2da suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py	Fri Nov 14 15:30:51 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py	Fri Nov 14 15:30:52 2008 -0800
@@ -29,14 +29,13 @@
 from XenKvmLib.classes import get_typed_class
 from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES
 from XenKvmLib.const import do_main
-from CimTest.ReturnCodes import PASS, FAIL, SKIP, XFAIL_RC
+from CimTest.ReturnCodes import PASS, FAIL, SKIP
 from XenKvmLib.enumclass import EnumInstances
 from XenKvmLib.common_util import get_host_info
 from XenKvmLib.const import get_provider_version
 
 sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
 test_dom  = "dom_elecap"
-bug_sblim = "00007"
 libvirtcim_crsc_changes = 723 
 
 def append_to_list(server, virt, poolname, valid_elc_id):
@@ -66,10 +65,13 @@
     server = options.ip
     virt = options.virt
 
-    status, host_name, host_ccn = get_host_info(server, virt)
+    status, host_inst = get_host_info(server, virt)
     if status != PASS:
         logger.error("Failed to get host info")
         return status
+
+    host_ccn = host_inst.CreationClassName
+    host_name = host_inst.Name
 
     try:
         an = get_typed_class(virt, "ElementCapabilities")
@@ -101,10 +103,7 @@
     if len(elc) == 0:
         logger.error("'%s' association failed, expected at least one instance",
                      an)
-        if host_ccn == 'Linux_ComputerSystem':
-           return XFAIL_RC(bug_sblim)
-        else:
-           return FAIL
+        return FAIL
 
     for i in elc:
         if i.classname not in valid_elc_name:
diff -r 5f39bb761dcb -r 8d5eb7acc2da suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py	Fri Nov 14 15:30:51 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py	Fri Nov 14 15:30:52 2008 -0800
@@ -119,10 +119,13 @@
     cap_list = {"VirtualSystemManagementCapabilities" : "ManagementCapabilities",
                 "VirtualSystemMigrationCapabilities"  : "MigrationCapabilities"}
 
-    status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+    status, host_inst = get_host_info(options.ip, options.virt)
     if status != PASS:
         logger.error("Failed to get host info")
         return status
+
+    host_ccn = host_inst.CreationClassName
+    host_name = host_inst.Name
 
     for k, v in cap_list.iteritems():
         cn = get_typed_class(options.virt, k)
diff -r 5f39bb761dcb -r 8d5eb7acc2da suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py	Fri Nov 14 15:30:51 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py	Fri Nov 14 15:30:52 2008 -0800
@@ -54,10 +54,9 @@
 from XenKvmLib.classes import get_typed_class
 from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES
 from XenKvmLib.const import do_main
-from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+from CimTest.ReturnCodes import PASS, FAIL
 
 sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
-bug_sblim = '00007'
 
 def print_err(err, detail, cn):
     logger.error(err % cn)
@@ -92,12 +91,9 @@
                      CreationClassName = cn,
                                 Name = name)
         if len(assoc_info) < 1:
-            if cn == 'Linux_ComputerSystem':
-               return XFAIL_RC(bug_sblim), assoc_info
-            else:
-               logger.error("%s returned %i %s objects", an,
-                            len(assoc_info), qcn)
-               return FAIL, assoc_info
+            logger.error("%s returned %i %s objects", an,
+                         len(assoc_info), qcn)
+            return FAIL, assoc_info
     except Exception, detail:
         print_err(CIM_ERROR_ASSOCIATORNAMES, detail, cn)
         status = FAIL
@@ -192,14 +188,14 @@
                }
     
     # Get the host info
-    status, host_name, classname = get_host_info(server, virt)
+    status, host_inst = get_host_info(server, virt)
     if status != PASS:
         return status
 
     an   = get_typed_class(virt, 'HostedService')
-    cn   = classname
+    cn   = host_inst.CreationClassName 
     qcn  = 'Service'
-    name = host_name
+    name = host_inst.Name
     # Get the service available on the host
     status, service_assoc_info = get_assoc_info(server, cn, an, qcn, name)
     if status != PASS or len(service_assoc_info) == 0:




More information about the Libvirt-cim mailing list