[PATCH 0 of 3] [TEST].2# ResourceAllocationFromPool 02~04 for XenFV and KVM support

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1207101750 25200 # Node ID f382e463f2c4e33b2298ccc38df8ffebd298deca # Parent 2a4a86706ee4bdb3cf3d0c20d38718e9fb6bc74f [TEST] ResourceAllocationFromPool.02 for XenFV and KVM support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r 2a4a86706ee4 -r f382e463f2c4 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Tue Apr 01 19:06:53 2008 +0530 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Tue Apr 01 19:02:30 2008 -0700 @@ -31,7 +31,7 @@ from CimTest.Globals import log_param, l from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] @do_main(sup_types) def main(): @@ -42,21 +42,22 @@ def main(): key_list = ["DeviceID", "CreationClassName", "SystemName", "SystemCreationClassName"] try: - mem = devices.enumerate(options.ip, 'Memory', key_list) + mem = devices.enumerate(options.ip, 'Memory', key_list, options.virt) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % devices.Xen_Memory) + logger.error(Globals.CIM_ERROR_ENUMERATE % 'Memory') return FAIL try: - proc = devices.enumerate(options.ip, 'Processor', key_list) + proc = devices.enumerate(options.ip, 'Processor', key_list, options.virt) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % devices.Xen_Processor) + logger.error(Globals.CIM_ERROR_ENUMERATE % 'Processor') return FAIL for i in range(len(mem)): try: - mempool = assoc.AssociatorNames(options.ip, "Xen_ResourceAllocationFromPool", - "Xen_MemResourceAllocationSettingData", + mempool = assoc.AssociatorNames(options.ip, "ResourceAllocationFromPool", + "MemResourceAllocationSettingData", + options.virt, InstanceID = mem[i].DeviceID) except Exception: logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % mem[i].DeviceID) @@ -72,8 +73,9 @@ def main(): for j in range(len(proc)): try: - procpool = assoc.AssociatorNames(options.ip, "Xen_ResourceAllocationFromPool", - "Xen_ProcResourceAllocationSettingData", + procpool = assoc.AssociatorNames(options.ip, "ResourceAllocationFromPool", + "ProcResourceAllocationSettingData", + options.virt, InstanceID = proc[j].DeviceID) except Exception: logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % proc[j].DeviceID)

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1207102127 25200 # Node ID 75a8df2db061d1a3998e5c6f0528563563d28a93 # Parent f382e463f2c4e33b2298ccc38df8ffebd298deca [TEST] ResourceAllocationFromPool.03 for XenFV and KVM support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r f382e463f2c4 -r 75a8df2db061 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Tue Apr 01 19:02:30 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Tue Apr 01 19:08:47 2008 -0700 @@ -24,11 +24,12 @@ import pywbem import pywbem from pywbem.cim_obj import CIMInstanceName from XenKvmLib import assoc +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] exp_rc = 6 #CIM_ERR_NOT_FOUND exp_desc = "No such instance (wrong) - resource pool type mismatch" @@ -42,7 +43,8 @@ def main(): status = FAIL - poollist = {"Xen_MemoryPool" : "wrong", "Xen_ProcessorPool" : "wrong"} + poollist = {get_typed_class(options.virt, "MemoryPool") : "wrong", + get_typed_class(options.virt, "ProcessorPool") : "wrong"} conn = assoc.myWBEMConnection('http://%s' % options.ip, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) @@ -52,7 +54,8 @@ def main(): names = [] try: - names = conn.AssociatorNames(instanceref, AssocClass = "Xen_ResourceAllocationFromPool") + names = conn.AssociatorNames(instanceref, + AssocClass = get_typed_class(options.virt, "ResourceAllocationFromPool")) rc = 0 except pywbem.CIMError, (rc, desc): if rc == exp_rc and desc.find(exp_desc) >= 0:

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1207102363 25200 # Node ID 4fe59e28f8ca31b614a3e40874c81704d2fe3929 # Parent 75a8df2db061d1a3998e5c6f0528563563d28a93 [TEST] ResourceAllocationFromPool.04 for XenFV and KVM support Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r 75a8df2db061 -r 4fe59e28f8ca suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Tue Apr 01 19:08:47 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Tue Apr 01 19:12:43 2008 -0700 @@ -24,11 +24,12 @@ import pywbem import pywbem from pywbem.cim_obj import CIMInstanceName from XenKvmLib import assoc +from XenKvmLib.classes import get_typed_class from CimTest import Globals from CimTest.Globals import log_param, logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -sup_types = ['Xen'] +sup_types = ['Xen', 'XenFV', 'KVM'] exp_rc = 6 #CIM_ERR_NOT_FOUND exp_desc = "No such instance" @@ -41,7 +42,8 @@ def main(): status = FAIL - dataset = {"Xen_MemResourceAllocationSettingData" : "wrong", "Xen_ProcResourceAllocationSettingData" : "wrong"} + dataset = {get_typed_class(options.virt, "MemResourceAllocationSettingData") : "wrong", + get_typed_class(options.virt, "ProcResourceAllocationSettingData") : "wrong"} conn = assoc.myWBEMConnection('http://%s' % options.ip, (Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS) @@ -51,7 +53,8 @@ def main(): names = [] try: - names = conn.AssociatorNames(instanceref, AssocClass = "Xen_ResourceAllocationFromPool") + names = conn.AssociatorNames(instanceref, + AssocClass = get_typed_class(options.virt, "ResourceAllocationFromPool")) rc = 0 except pywbem.CIMError, (rc, desc): if rc == exp_rc and desc.find(exp_desc) >= 0:
participants (1)
-
Guo Lian Yun