# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213794010 25200
# Node ID 9a47268dea2f70cb290f85e24c3bf0d2bada66e5
# Parent f4a167c62403c8aaaac5127d0c984c74ea863344
[TEST] Fixing the tc 04_vssd_to_rasd.py which was failing bcs of rasd.py changes.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r f4a167c62403 -r 9a47268dea2f suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py
--- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Tue Jun 17 13:20:47 2008 +0800
+++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Wed Jun 18 06:00:10 2008 -0700
@@ -51,8 +51,9 @@
from XenKvmLib import assoc
from XenKvmLib.vxml import get_class
from XenKvmLib.classes import get_typed_class
+from XenKvmLib import rasd
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
-verify_diskrasd_values, verify_memrasd_values
+verify_diskrasd_values, verify_memrasd_values, rasd_init_list
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -84,41 +85,6 @@
logger.error("Exception : %s", details)
return FAIL, vsxml_info
return PASS, vsxml_info
-
-def init_list(virt):
- """
- Creating the lists that will be used for comparisons.
- """
- procrasd = {
- "InstanceID" : '%s/%s' %(test_dom, "proc"),
- "ResourceType" : 3,
- "CreationClassName": get_typed_class(virt,
'ProcResourceAllocationSettingData')
- }
-
- netrasd = {
- "InstanceID" : '%s/%s' %(test_dom,test_mac),
- "ResourceType" : 10 ,
- "ntype1": "bridge",
- "ntype2": "ethernet",
- "CreationClassName": get_typed_class(virt,
'NetResourceAllocationSettingData')
- }
-
- address = vsxml.xml_get_disk_source()
- diskrasd = {
- "InstanceID" : '%s/%s' %(test_dom, test_disk),
- "ResourceType" : 17,
- "Address" : address,
- "CreationClassName": get_typed_class(virt,
'DiskResourceAllocationSettingData')
- }
- memrasd = {
- "InstanceID" : '%s/%s' %(test_dom, "mem"),
- "ResourceType" : 4,
- "AllocationUnits" : "KiloBytes",
- "VirtualQuantity" : (test_mem * 1024),
- "CreationClassName": get_typed_class(virt,
'MemResourceAllocationSettingData')
- }
-
- return procrasd, netrasd, diskrasd, memrasd
def get_inst_from_list(classname, vssd_list, filter_name, exp_val):
status = PASS
@@ -193,7 +159,17 @@
return status, vssdc_assoc_info
def verify_rasd_values(rasd_values_info):
- procrasd, netrasd, diskrasd, memrasd = init_list(virt)
+ status, rasd_values_list, in_list = rasd_init_list(vsxml, virt, test_disk,
+ test_dom, test_mac,
+ test_mem)
+ if status != PASS:
+ return status
+
+ procrasd = rasd_values_list['%s' %in_list['proc']]
+ netrasd = rasd_values_list['%s' %in_list['net']]
+ diskrasd = rasd_values_list['%s' %in_list['disk']]
+ memrasd = rasd_values_list['%s' %in_list['mem']]
+
try:
for rasd_instance in rasd_values_info:
CCName = rasd_instance.classname