# HG changeset patch
# User Deepti B.Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1249311520 25200
# Node ID c869eed16f8e6a01400f876c9f40ef22535975d7
# Parent e4d3d6799e9c73a7a68393782a4292187b777b01
[TEST] Fixing HostSystem/03_hs_to_settdefcap.py
Tested with KVM on F10 and current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r e4d3d6799e9c -r c869eed16f8e
suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Thu Jul 30 04:40:58
2009 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon Aug 03 07:58:40
2009 -0700
@@ -48,11 +48,12 @@
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.test_xml import testxml
from XenKvmLib.test_doms import destroy_and_undefine_all
-from XenKvmLib.rasd import get_exp_template_rasd_len
+from XenKvmLib.rasd import get_exp_template_rasd_len, \
+ libvirt_rasd_storagepool_changes
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "domgst_test"
@@ -203,13 +204,20 @@
rtype = { "%s_MemResourceAllocationSettingData" % virt : 4 }
else:
rtype = {
- "%s_DiskResourceAllocationSettingData" % virt : 17, \
- "%s_DiskPoolResourceAllocationSettingData" % virt : 17, \
- "%s_MemResourceAllocationSettingData" % virt : 4, \
- "%s_NetResourceAllocationSettingData" % virt : 10, \
- "%s_NetPoolResourceAllocationSettingData" % virt : 10, \
+ "%s_DiskResourceAllocationSettingData" % virt : 17,
+ "%s_DiskPoolResourceAllocationSettingData" % virt : 17,
+ "%s_MemResourceAllocationSettingData" % virt : 4,
+ "%s_NetResourceAllocationSettingData" % virt : 10,
+ "%s_NetPoolResourceAllocationSettingData" % virt : 10,
"%s_ProcResourceAllocationSettingData" % virt : 3
}
+
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if curr_cim_rev >= libvirt_rasd_storagepool_changes:
+ sto_vol_cn = 'StorageVolumeResourceAllocationSettingData'
+ storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn)
+ rtype[storagevol_rasd_cn] = 32768
+
try:
for ap in alloccap:
assoc_info = Associators(server,
diff -r e4d3d6799e9c -r c869eed16f8e suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Thu Jul 30 04:40:58 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Aug 03 07:58:40 2009 -0700
@@ -47,6 +47,8 @@
dccn = 'DisplayController'
pdcn = 'PointingDevice'
+libvirt_rasd_storagepool_changes = 934
+
def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server):
"""
Creating the lists that will be used for comparisons.
@@ -319,6 +321,8 @@
exp_base_num = 4
exp_cdrom = 4
+ # StoragePoolRASD record 1 for each of Min, Max, Default, and Incr
+ exp_storagepool_rasd = 4
exp_len = exp_base_num
if id == "DiskPool/0":
@@ -351,6 +355,9 @@
volumes = enum_volumes(virt, ip, id[1])
exp_len = (volumes * exp_base_num) + exp_cdrom
+ if rev >= libvirt_rasd_storagepool_changes:
+ exp_len += exp_storagepool_rasd
+
return exp_len
def get_exp_net_rasd_len(virt, rev, id):