[Libvirt-cim] [PATCH] [TEST] #4 Fix SettingsDefineCapabilities/01_forward.py with appropriate RASD objects for different platforms

yunguol at cn.ibm.com yunguol at cn.ibm.com
Wed Feb 11 07:48:35 UTC 2009


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1234338509 28800
# Node ID d6a47e2263ee7a15a4214c99b86f23fa22813090
# Parent  1bb347c22e6ed03032f359c8c28e59e94b7316c2
[TEST] #4 Fix SettingsDefineCapabilities/01_forward.py with appropriate RASD objects for different platforms

Updates from 3 to 4:
1) align the if statements
2) set exp_len = 4 before the if statements

Updates form 2 to 3:
Simplify the if statement

Updates form 1 to 2:
Add two branches of returned RASD objects number:
1) The valule to be 8 for Xen when rev >= 707 and rev < 805
2) The value to be 16 for Xen when rev >= 805
3) The value to be 8 for KVM when rev >= 805


Tested for KVM/Xen/LXC with current sources, KVM with F9 rpm.

Signed-off-by: Guolian Yun<yunguol at cn.ibm.com>

diff -r 1bb347c22e6e -r d6a47e2263ee suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py	Mon Feb 09 21:47:35 2009 -0800
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py	Tue Feb 10 23:48:29 2009 -0800
@@ -67,6 +67,7 @@
 
 platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
 libvirt_rasd_template_changes = 707
+libvirt_rasd_new_changes = 805
 
 memid = "MemoryPool/0"
 procid = "ProcessorPool/0"
@@ -171,14 +172,20 @@
                                            InstanceID = instid)  
 
             curr_cim_rev, changeset = get_provider_version(virt, server)
-            if 'DiskPool' in instid and (virt =='Xen' or virt == 'XenFV') and \
-                curr_cim_rev >= libvirt_rasd_template_changes:
+            exp_len = 4
+            if 'DiskPool' in instid:
                 # For Diskpool, we have info 1 for each of Min, Max, 
                 # default, Increment and 1 for each of PV and FV 
                 # hence 4 * 2 = 8 records
-                exp_len = 8
-            else:
-                exp_len = 4
+                if virt == 'Xen' or virt == 'XenFV':
+                    if curr_cim_rev >= libvirt_rasd_template_changes and \
+                       curr_cim_rev < libvirt_rasd_new_changes:
+                        exp_len = 8
+                    if curr_cim_rev >= libvirt_rasd_new_changes:  
+                        exp_len = 16
+                if virt == 'KVM':
+                    if curr_cim_rev >= libvirt_rasd_new_changes:
+                        exp_len = 8
 
             if len(assoc_info) != exp_len:
                 logger.error("%s returned %i ResourcePool objects instead"




More information about the Libvirt-cim mailing list