# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1226300302 28800
# Node ID d0b174efd49c759768adc21db27f0ff7ddddab79
# Parent 6591949e8afdddce6aa72022e33f0ce063ec60a1
[TEST] Fix HostSystem/02_hostsystem_to_rasd.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 6591949e8afd -r d0b174efd49c
suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Wed Nov 05 22:03:48
2008 -0800
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Sun Nov 09 22:58:22
2008 -0800
@@ -57,7 +57,8 @@
CIM_ERROR_ASSOCIATORS
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
-verify_diskrasd_values, verify_memrasd_values, rasd_init_list
+verify_diskrasd_values, verify_memrasd_values, verify_displayrasd_values, \
+rasd_init_list
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
bug_sblim = '00007'
@@ -179,6 +180,8 @@
status = verify_diskrasd_values(assoc_info[index], rasd)
elif 'MemResourceAllocationSettingData' in CCName:
status = verify_memrasd_values(assoc_info[index], rasd)
+ elif 'GraphicsResourceAllocationSettingData' in CCName:
+ status = verify_displayrasd_values(assoc_info[index], rasd)
else:
status = FAIL
if status != PASS:
diff -r 6591949e8afd -r d0b174efd49c suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Nov 05 22:03:48 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Sun Nov 09 22:58:22 2008 -0800
@@ -34,10 +34,12 @@
nasd_cn = 'NetResourceAllocationSettingData'
dasd_cn = 'DiskResourceAllocationSettingData'
masd_cn = 'MemResourceAllocationSettingData'
+dcrasd_cn = 'GraphicsResourceAllocationSettingData'
proccn = 'Processor'
memcn = 'Memory'
netcn = 'NetworkPort'
diskcn = 'LogicalDisk'
+dccn = 'DisplayController'
def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem):
"""
@@ -48,11 +50,13 @@
mem_cn = get_typed_class(virt, memcn)
net_cn = get_typed_class(virt, netcn)
disk_cn = get_typed_class(virt, diskcn)
+ dc_cn = get_typed_class(virt, dccn)
- in_list = { 'proc' : proc_cn,
- 'mem' : mem_cn,
- 'net' : net_cn,
- 'disk' : disk_cn
+ in_list = { 'proc' : proc_cn,
+ 'mem' : mem_cn,
+ 'net' : net_cn,
+ 'disk' : disk_cn,
+ 'display' : dc_cn
}
try:
@@ -79,6 +83,9 @@
"ResourceType" : 4,
"AllocationUnits" : "KiloBytes",
"VirtualQuantity" : (t_mem * 1024),
+ },
+ dc_cn : {
+ "InstanceID" : "%s/%s" %(t_dom,
"graphics")
}
}
except Exception, details:
@@ -106,6 +113,13 @@
logger.error("%s Mismatch", 'InstanceID')
logger.error("Returned %s instead of %s",
assoc_info['InstanceID'], list['InstanceID'])
+
+def verify_displayrasd_values(assoc_info, displayrasd_list):
+ status = PASS
+ if assoc_info['InstanceID'] != displayrasd_list['InstanceID']:
+ InstId_err(assoc_info, displayrasd_list)
+ status = FAIL
+ return status
def verify_procrasd_values(assoc_info, procrasd_list):
status = PASS