[Libvirt-cim] [PATCH] [TEST] #2 Skipping 01_verify_refprof.py, 02_refprofile_errs.py tc if cim_rev is less than 501

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Wed May 7 06:20:41 UTC 2008


# HG changeset patch
# User Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
# Date 1210141230 25200
# Node ID f41c618f3d5ba81d0588440b1a62e8916dc9d0a7
# Parent  84517c1beb32bff13f352ed53ece0f6a1a84fe41
[TEST] #2 Skipping 01_verify_refprof.py, 02_refprofile_errs.py  tc if cim_rev is less than 501.

1) Rebased with the latest test source.
2) Used the library function print_field_error().

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

diff -r 84517c1beb32 -r f41c618f3d5b suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py
--- a/suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py	Tue May 06 14:47:59 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ReferencedProfile/01_verify_refprof.py	Tue May 06 23:20:30 2008 -0700
@@ -78,13 +78,12 @@ from CimTest.Globals import logger, CIM_
 from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS
 from CimTest.Globals import do_main
 from XenKvmLib.classes import get_typed_class
-from CimTest.ReturnCodes import FAIL, PASS
+from CimTest.ReturnCodes import FAIL, PASS, SKIP
+from XenKvmLib.const import CIM_REV
+from XenKvmLib.common_util import print_field_error
 
 sup_types = ['Xen', 'KVM', 'XenFV']
-
-def print_field_error(fieldname, ret_value, exp_value):
-    logger.error("%s Mismatch", fieldname)
-    logger.error("Returned %s instead of %s", ret_value, exp_value)
+libvirtcim_rev = 501
 
 def get_proflist():
     proflist = []
@@ -94,7 +93,7 @@ def get_proflist():
         proflist = enumclass.enumerate(server, reg_classname, key_list, virt) 
         if len(proflist) < 5:
             logger.error("%s returned %i %s objects, expected atleast 5", 
-                                  reg_classname, len(proflist), 'Profile')
+                        reg_classname, len(proflist), 'Profile')
             status = FAIL
 
     except Exception, detail:
@@ -138,8 +137,9 @@ def get_refprof_verify_info(proflist):
     assoc_name =  get_typed_class(virt, 'ReferencedProfile')
     for instid in proflist:
         try:
-            assoc_info = Associators(server, assoc_name, reg_classname, virt, InstanceID = instid, 
-                                                                CreationClassName = reg_classname)
+            assoc_info = Associators(server, assoc_name, reg_classname, 
+                                     virt, InstanceID = instid, 
+                                     CreationClassName = reg_classname)
             if len(assoc_info) < 1:
                 logger.error("%s returned %i %s objects, expected atleast 1", 
                              assoc_name, len(assoc_info), 'Profiles')
@@ -165,6 +165,13 @@ def main():
     virt = options.virt
     server = options.ip
     status = PASS
+
+    # Referenced Profile was introduced as part of changeset 501 
+    # and is not available in the libvirt-cim rpm, hence skipping tc
+    # if CIM_REV  501
+    if CIM_REV < libvirtcim_rev:
+        return SKIP
+
     prev_namespace = Globals.CIM_NS
     Globals.CIM_NS = 'root/interop'
     reg_classname = get_typed_class(virt, 'RegisteredProfile')
diff -r 84517c1beb32 -r f41c618f3d5b suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py
--- a/suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py	Tue May 06 14:47:59 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ReferencedProfile/02_refprofile_errs.py	Tue May 06 23:20:30 2008 -0700
@@ -58,10 +58,13 @@ from CimTest.Globals import logger, CIM_
 from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS
 from CimTest.Globals import do_main, CIM_USER, CIM_PASS
 from XenKvmLib.classes import get_typed_class
-from CimTest.ReturnCodes import FAIL, PASS
+from CimTest.ReturnCodes import FAIL, PASS, SKIP
 from XenKvmLib.common_util import try_assoc
+from XenKvmLib.const import CIM_REV
 
 sup_types = ['Xen', 'KVM', 'XenFV']
+libvirtcim_rev = 501
+
 expr_values = {
                 'INVALID_Instid_KeyName'  :  {
                                                 'rc'    : pywbem.CIM_ERR_FAILED, 
@@ -121,6 +124,12 @@ def main():
     virt = options.virt
     server = options.ip
     status = PASS
+    # Referenced Profile was introduced as part of changeset 501 
+    # and is not available in the libvirt-cim rpm, hence skipping tc
+    # if CIM_REV  501
+    if CIM_REV < libvirtcim_rev:
+        return SKIP
+
     prev_namespace = Globals.CIM_NS
     Globals.CIM_NS = 'root/interop'
     reg_classname = get_typed_class(virt, 'RegisteredProfile')




More information about the Libvirt-cim mailing list