# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213615884 25200
# Node ID 15b3d305bec5e26313bf96824a670afe91aae357
# Parent 36a1ac9fce4185f796f0a07b7f31c107b94f3ed7
[TEST] #2 Fixing the 02_hostsystem_to_rasd.py tc of HostSystem.
Changes from Patch 1 to 2:
--------------------------
1) Updated the return value of the rasd_init_list().
Patch 1:
--------
1) Fixing the tc failure bcs of the modifications that was done to default network type.
2) Using the rasd_init_list() fn of the rasd.py .
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 36a1ac9fce41 -r 15b3d305bec5
suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Mon Jun 16 04:30:23
2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Mon Jun 16 04:31:24
2008 -0700
@@ -57,7 +57,7 @@
CIM_ERROR_ASSOCIATORS
from CimTest.ReturnCodes import PASS, FAIL
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
from XenKvmLib.const import CIM_REV
sup_types = ['Xen', 'KVM', 'XenFV']
@@ -69,47 +69,6 @@
test_mac = "00:11:22:33:44:aa"
rev = 529
proc_instid_rev = 590
-
-def init_list(vsxml, virt="Xen"):
- """
- Creating the lists that will be used for comparisons.
- """
- disk_path = vsxml.xml_get_disk_source()
- proc_cn = get_typed_class(virt, "Processor")
- mem_cn = get_typed_class(virt, "Memory")
- net_cn = get_typed_class(virt, "NetworkPort")
- disk_cn = get_typed_class(virt, "LogicalDisk")
-
- rasd_values = {
- proc_cn : {
- "InstanceID" : '%s/%s'
%(test_dom, "proc"),
- "ResourceType" : 3,
- },
- disk_cn : {
- "InstanceID" : '%s/%s'
%(test_dom, test_disk),
- "ResourceType" : 17,
- "Address" : disk_path,
- },
- net_cn : {
- "InstanceID" : '%s/%s'
%(test_dom,test_mac),
- "ResourceType" : 10 ,
- "ntype1": "bridge",
- "ntype2": "ethernet",
- },
- mem_cn : {
- "InstanceID" : '%s/%s'
%(test_dom, "mem"),
- "ResourceType" : 4,
- "AllocationUnits" :
"KiloBytes",
- "VirtualQuantity" : (test_mem *
1024),
- }
- }
- if CIM_REV < rev:
- rasd_values[mem_cn]['AllocationUnits'] = "MegaBytes"
-
- if CIM_REV < proc_instid_rev:
- rasd_values[proc_cn]['InstanceID'] = '%s/%s' %(test_dom, 0)
-
- return rasd_values
def setup_env(server, virt="Xen"):
vsxml_info = None
@@ -185,7 +144,13 @@
classname_keyvalue = sd_assoc_info[i]['CreationClassName']
deviceid = sd_assoc_info[i]['DeviceID']
in_setting_define_state[classname_keyvalue] = deviceid
- rasd_values = init_list(vsxml, virt)
+
+ status, rasd_values, in_list = rasd_init_list(vsxml, virt,
+ test_disk, test_dom,
+ test_mac, test_mem)
+ if status != PASS:
+ return status
+
an = get_typed_class(virt, 'SettingsDefineState')
sccn = get_typed_class(virt, 'ComputerSystem')
for cn, devid in sorted(in_setting_define_state.items()):