# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1206950255 25200
# Node ID 1542ed9f28baf4b5025b4fffc0391131c76c2c5e
# Parent e1cd8daac37d7ac78879912e4c635f1e9b17ed0f
[TEST] update RAFP.02 for XenFV and KVM support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r e1cd8daac37d -r 1542ed9f28ba
suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Mon Mar 31
00:56:24 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Mon Mar 31
00:57:35 2008 -0700
@@ -26,12 +26,13 @@ from VirtLib import utils
from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import devices
+from XenKvmLib.classes import get_typed_class
from XenKvmLib.devices import Xen_Memory, Xen_Processor
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']
@do_main(sup_types)
def main():
@@ -42,21 +43,22 @@ def main():
key_list = ["DeviceID", "CreationClassName",
"SystemName",
"SystemCreationClassName"]
try:
- mem = devices.enumerate(options.ip, Xen_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, Xen_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 +74,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)