# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1243630742 25200
# Node ID a22bbefc05e5b294b254c58236b0f2abda65a23a
# Parent 46664d3f9e880c69ed43a06f36d0d4f33bd29f67
[TEST] Add support for DiskPoolRASD / NetPoolRASD to get_exp_template_rasd_len()
Also update HostSystem 03 to support DiskPoolRASD / NetPoolRASD
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 46664d3f9e88 -r a22bbefc05e5
suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri May 29 14:39:36
2009 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri May 29 13:59:02
2009 -0700
@@ -204,8 +204,10 @@
else:
rtype = {
"%s_DiskResourceAllocationSettingData" % virt : 17, \
+ "%s_DiskPoolResourceAllocationSettingData" % virt : 17, \
"%s_MemResourceAllocationSettingData" % virt : 4, \
"%s_NetResourceAllocationSettingData" % virt : 10, \
+ "%s_NetPoolResourceAllocationSettingData" % virt : 10, \
"%s_ProcResourceAllocationSettingData" % virt : 3
}
try:
diff -r 46664d3f9e88 -r a22bbefc05e5 suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri May 29 14:39:36 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri May 29 13:59:02 2009 -0700
@@ -304,45 +304,76 @@
return rasd_insts, PASS
-def get_exp_template_rasd_len(virt, ip, id):
+def get_exp_disk_rasd_len(virt, ip, rev, id):
libvirt_rasd_template_changes = 707
libvirt_rasd_new_changes = 805
libvirt_rasd_dpool_changes = 839
- curr_cim_rev, changeset = get_provider_version(virt, ip)
-
# For Diskpool, we have info 1 for each of Min, Max, Default, and Incr
exp_base_num = 4
exp_cdrom = 4
- exp_len = exp_base_num
+ exp_len = exp_base_num
- if 'DiskPool' in id:
- if virt == 'Xen' or virt == 'XenFV':
- # For Xen and XenFV, there is a template for PV and FV, so you
- # end up with double the number of templates
- xen_multi = 2
+ if id == "DiskPool/0":
+ pool_types = 3
+ return exp_base_num * pool_types
+
+ if virt == 'Xen' or virt == 'XenFV':
+ # For Xen and XenFV, there is a template for PV and FV, so you
+ # end up with double the number of templates
+ xen_multi = 2
- if curr_cim_rev >= libvirt_rasd_template_changes and \
- curr_cim_rev < libvirt_rasd_new_changes:
- exp_len = exp_base_num + exp_cdrom
+ if rev >= libvirt_rasd_template_changes and \
+ rev < libvirt_rasd_new_changes:
+ exp_len = exp_base_num + exp_cdrom
- elif curr_cim_rev >= libvirt_rasd_new_changes and \
- curr_cim_rev < libvirt_rasd_dpool_changes:
- exp_len = (exp_base_num + exp_cdrom) * xen_multi
+ elif rev >= libvirt_rasd_new_changes and \
+ rev < libvirt_rasd_dpool_changes:
+ exp_len = (exp_base_num + exp_cdrom) * xen_multi
- elif curr_cim_rev >= libvirt_rasd_dpool_changes:
- volumes = enum_volumes(virt, ip)
- exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi
+ elif rev >= libvirt_rasd_dpool_changes:
+ volumes = enum_volumes(virt, ip)
+ exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi
- elif virt == 'KVM':
- if curr_cim_rev >= libvirt_rasd_new_changes and \
- curr_cim_rev < libvirt_rasd_dpool_changes:
- exp_len = exp_base_num + exp_cdrom
+ elif virt == 'KVM':
+ if rev >= libvirt_rasd_new_changes and \
+ rev < libvirt_rasd_dpool_changes:
+ exp_len = exp_base_num + exp_cdrom
- elif curr_cim_rev >= libvirt_rasd_dpool_changes:
- volumes = enum_volumes(virt, ip)
- exp_len = (volumes * exp_base_num) + exp_cdrom
+ elif rev >= libvirt_rasd_dpool_changes:
+ volumes = enum_volumes(virt, ip)
+ exp_len = (volumes * exp_base_num) + exp_cdrom
return exp_len
+def get_exp_net_rasd_len(virt, rev, id):
+ net_rasd_template_changes = 861
+
+ exp_base_num = 4
+
+ if id == "NetworkPool/0":
+ pool_types = 3
+ forward_modes = 2
+
+ return (exp_base_num * pool_types) + (exp_base_num * forward_modes)
+
+ if rev >= net_rasd_template_changes:
+ dev_types = 2
+
+ return exp_base_num * dev_types
+
+def get_exp_template_rasd_len(virt, ip, id):
+ curr_cim_rev, changeset = get_provider_version(virt, ip)
+
+ exp_len = 4
+
+ if 'DiskPool' in id:
+ exp_len = get_exp_disk_rasd_len(virt, ip, curr_cim_rev, id)
+
+ elif 'NetworkPool' in id:
+ exp_len = get_exp_net_rasd_len(virt, curr_cim_rev, id)
+
+ return exp_len
+
+
Show replies by date
This tc failed with the following error on Xen with current source:
--------------------------------------------------------------------
HostSystem - 03_hs_to_settdefcap.py: FAIL
ERROR - 'Xen_SettingsDefineCapabilities' returned 16 RASD objects
instead of 8
--------------------------------------------------------------------
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik(a)linux.vnet.ibm.com