[PATCH 0 of 3] [TEST]bundles of ElementConforms tc for XenFV and KVM support

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1207033274 25200 # Node ID bd214f299aa9e4e407b5ca60f3f33c97254379c5 # Parent 5d47437104551b638aa75e2e525e49ec4b41e3ec [TEST] ElementConforms.01 for XenFV and KVM support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r 5d4743710455 -r bd214f299aa9 suites/libvirt-cim/cimtest/ElementConforms/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Mon Mar 31 07:54:19 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Tue Apr 01 00:01:14 2008 -0700 @@ -3,6 +3,7 @@ # Copyright 2008 IBM Corp. # # Authors: +# Guolian Yun <yunguol@cn.ibm.com> # Kaitlin Rupert <karupert@us.ibm.com> # Veerendra Chandrappa <vechandr@in.ibm.com> # @@ -35,11 +36,12 @@ from VirtLib import utils, live from VirtLib import utils, live from XenKvmLib import assoc from XenKvmLib.test_doms import destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class from CimTest.Globals import log_param, logger, CIM_ERROR_ASSOCIATORS, do_main from CimTest import Globals from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] def verify_cs(item, id): if item['EnabledState'] != 2 and \ @@ -79,7 +81,7 @@ def main(): log_param() status = PASS - destroy_and_undefine_all(options.ip) + destroy_and_undefine_all(options.ip, options.virt) prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' @@ -89,32 +91,36 @@ def main(): "InstID1" : "CIM:DSP1042-SystemVirtualization-1.0.0" , "InstID2" : "CIM:DSP1057-VirtualSystem-1.0.0a" } + hs = get_typed_class(options.virt, "HostSystem") + cs = get_typed_class(options.virt, "ComputerSystem") + devlist = [ - "Xen_HostSystem" , \ - "Xen_ComputerSystem" + hs , \ + cs ] for args, devid in inst_lst.items() : try: - assoc_info = assoc.Associators(options.ip, \ - "Xen_ElementConformsToProfile", - "Xen_RegisteredProfile", - InstanceID = devid) + assoc_info = assoc.Associators(options.ip, + "ElementConformsToProfile", + "RegisteredProfile", + options.virt, + InstanceID = devid) if len(assoc_info) < 1: status = FAIL - logger.error("Xen_ElementConformsToProfile returned %i\ - Xen_RegisteredProfile objects" % len(assoc_info)) + logger.error("ElementConformsToProfile returned %i\ + RegisteredProfile objects" % len(assoc_info)) break count = 0 for info in assoc_info: - if info['CreationClassName'] == "Xen_ComputerSystem" : + if info['CreationClassName'] == cs : + if options.virt == "Xen" or options.virt == "XenFV": + if info['Name'] == 'Domain-0' : + count = count + 1 + verify_cs(info, devid) - if info['Name'] == 'Domain-0' : - count = count + 1 - verify_cs(info, devid) - - elif info['CreationClassName'] == "Xen_HostSystem" and \ + elif info['CreationClassName'] == hs and \ info['Name'] == host: count = count + 1 verify_host(info, devid) @@ -133,7 +139,7 @@ def main(): except BaseException, detail: - logger.error(CIM_ERROR_ASSOCIATORS, 'Xen_ElementConformsToProfile') + logger.error(CIM_ERROR_ASSOCIATORS, 'ElementConformsToProfile') logger.error("Exception: %s" % detail) status = FAIL

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1207033414 25200 # Node ID f34da7c52c40aaba7ec9a9475398a5fcb8825c12 # Parent bd214f299aa9e4e407b5ca60f3f33c97254379c5 [TEST] ElementConforms.02 for XenFV and KVM support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r bd214f299aa9 -r f34da7c52c40 suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Tue Apr 01 00:01:14 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Tue Apr 01 00:03:34 2008 -0700 @@ -3,6 +3,7 @@ # Copyright 2008 IBM Corp. # # Authors: +# Guolian Yun <yunguol@cn.ibm.com> # Kaitlin Rupert <karupert@us.ibm.com> # Veerendra Chandrappa <vechandr@in.ibm.com> # @@ -45,11 +46,13 @@ from XenKvmLib import hostsystem from XenKvmLib import hostsystem from XenKvmLib import computersystem from XenKvmLib import assoc -from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all +from XenKvmLib.classes import get_typed_class +from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib import enumclass +from XenKvmLib.vxml import XenXML, KVMXML, get_class from CimTest.ReturnCodes import PASS, FAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] test_dom = "domgst" @@ -82,10 +85,10 @@ def main(): status = FAIL log_param() - destroy_and_undefine_all(options.ip) - test_xml = testxml(test_dom) - - ret = test_domain_function(test_xml, options.ip, cmd = "create") + destroy_and_undefine_all(options.ip, options.virt) + vsxml = get_class(options.virt)(test_dom) + vsxml.define(options.ip) + ret = vsxml.start(options.ip) if not ret: logger.error("ERROR: Failed to Create the dom: %s" % test_dom) return status @@ -93,7 +96,7 @@ def main(): inst_list = [] try: - cs_list = computersystem.enumerate(options.ip) + cs_list = computersystem.enumerate(options.ip, options.virt) # The len should be atleast two, as the CS returns info # one regarding VS and the other one for Domain-0. if len(cs_list) < 1: @@ -109,7 +112,7 @@ def main(): return status #Getting the hostname, to verify with the value returned by the assoc. - host_sys = hostsystem.enumerate(options.ip) + host_sys = hostsystem.enumerate(options.ip, options.virt) if len(host_sys) < 1: logger.error("ERROR: Enumerate returned 0 host instances") @@ -126,15 +129,16 @@ def main(): prev_namespace = Globals.CIM_NS Globals.CIM_NS = 'root/interop' - + try: key_list = ["InstanceID"] proflist = enumclass.enumerate(options.ip, \ - enumclass.Xen_RegisteredProfile, \ - key_list) + "RegisteredProfile", \ + key_list, + options.virt) except Exception, detail: logger.error(CIM_ERROR_ENUMERATE, \ - 'Xen_RegisteredProfile') + 'RegisteredProfile') logger.error("Exception: %s", detail) return status @@ -148,8 +152,9 @@ def main(): cn = item.CreationClassName name = item.Name profs = assoc.Associators(options.ip, - "Xen_ElementConformsToProfile", - cn, + "ElementConformsToProfile", + cn, + options.virt, CreationClassName=cn, Name=name) if len(profs) != 1: @@ -161,11 +166,13 @@ def main(): logger.error("Verification of profile instance failed") except Exception, detail: - logger.error(CIM_ERROR_ASSOCIATORS, 'Xen_RegisteredProfile') + logger.error(CIM_ERROR_ASSOCIATORS, 'RegisteredProfile') logger.error("Exception: %s", detail) status = FAIL - - ret = test_domain_function(test_dom, options.ip, cmd = "destroy") + + vsxml.destroy(options.ip) + vsxml.undefine(options.ip) + return status if __name__ == "__main__":

GY> + vsxml = get_class(options.virt)(test_dom) As mentioned in regards to a previous patch by Zhen Gang, I'd like a temporary variable here to avoid confusion. I'll apply the other two patches in this set though. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

libvirt-cim-bounces@redhat.com wrote on 2008-04-01 23:33:38:
GY> + vsxml = get_class(options.virt)(test_dom)
As mentioned in regards to a previous patch by Zhen Gang, I'd like a temporary variable here to avoid confusion.
Good catch, changes and resubmit.
I'll apply the other two patches in this set though.
Thanks!
Thanks!
-- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com [attachment "attwmvi6.dat" deleted by Guo Lian Yun/China/IBM] _______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1207033501 25200 # Node ID 2842b5c65fefad7348abd031bd3977ff3db760be # Parent f34da7c52c40aaba7ec9a9475398a5fcb8825c12 [TEST] ElementConforms.03 for XenFV and KVM support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r f34da7c52c40 -r 2842b5c65fef suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py --- a/suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py Tue Apr 01 00:03:34 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py Tue Apr 01 00:05:01 2008 -0700 @@ -55,14 +55,13 @@ from VirtLib import utils from VirtLib import utils from XenKvmLib import assoc from XenKvmLib.common_util import try_assoc +from XenKvmLib.classes import get_typed_class from CimTest.ReturnCodes import PASS, FAIL from CimTest import Globals from CimTest.Globals import log_param, logger, CIM_USER, CIM_PASS, do_main -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] -classname = 'Xen_RegisteredProfile' -ac_classname = 'Xen_ElementConformsToProfile' bug = '92642' expr_values = { @@ -72,7 +71,9 @@ expr_values = { 'desc' : 'No such instance' } } -def try_invalid_assoc(name_val, i, field): +def try_invalid_assoc(name_val, i, field, virt="Xen"): + classname = get_typed_class(virt, "RegisteredProfile") + ac_classname = get_typed_class(virt, "ElementConformsToProfile") j = 0 keys = {} temp = name_val[i] @@ -111,7 +112,7 @@ def main(): status = retval for i in range(len(tc_scen)): - retval = try_invalid_assoc(vs_name_val, i, tc_scen[i]) + retval = try_invalid_assoc(vs_name_val, i, tc_scen[i], options.virt) if retval != PASS: status = retval
participants (2)
-
Dan Smith
-
Guo Lian Yun