# HG changeset patch
# User Deepti B.Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1249366870 25200
# Node ID 99510f152e670db0948e26add79869f266b826e5
# Parent a95d4b521cf64765ef1f441d9cdb0f82fd6c37b2
[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 a95d4b521cf6 -r 99510f152e67
suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon Aug 03 23:14:01
2009 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon Aug 03 23:21:10
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,
@@ -244,7 +252,8 @@
def check_rasd_vals(inst, rt):
try:
if inst['ResourceType'] != rt:
- logger.error("In ResourceType for %s ", rt)
+ logger.error("ResourceType Mismatch, Got '%s' Expected
'%s' ",
+ inst['ResourceType'], rt)
return FAIL
except Exception, detail:
logger.error("Error checking RASD attribute values %s", detail)