# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1239851971 25200
# Node ID de971738caf9e9b3eae3c3fe8dc65cc7114a7ff1
# Parent 4ec367c94c356de7fac5a19ffe215c316d0cdcd1
[TEST] Fix SettingsDefineCapabilities/01_forward.py with the provider's changes of the
output of ac association when using DiskPool as input
Tested for KVM with current sources and rpm
Signed-off-by: Guolian Yun<yunguol(a)cn.ibm.com
diff -r 4ec367c94c35 -r de971738caf9
suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Apr 08
02:22:53 2009 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Apr 15
20:19:31 2009 -0700
@@ -64,10 +64,12 @@
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import print_field_error
from XenKvmLib.const import get_provider_version
+from XenKvmLib.pool import enum_volumes
platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
libvirt_rasd_template_changes = 707
libvirt_rasd_new_changes = 805
+libvirt_rasd_dpool_changes = 839
memid = "MemoryPool/0"
procid = "ProcessorPool/0"
@@ -184,8 +186,12 @@
if curr_cim_rev >= libvirt_rasd_new_changes:
exp_len = 16
if virt == 'KVM':
- if curr_cim_rev >= libvirt_rasd_new_changes:
+ if curr_cim_rev >= libvirt_rasd_new_changes and \
+ curr_cim_rev < libvirt_rasd_dpool_changes:
exp_len = 8
+ if curr_cim_rev >= libvirt_rasd_dpool_changes:
+ volumes = enum_volumes(virt, server)
+ exp_len = volumes * 4
if len(assoc_info) != exp_len:
logger.error("%s returned %i ResourcePool objects instead"