[Libvirt-cim] [PATCH] [TEST] Fixing 15_mod_system_settings.py tc of VSMS to work with libvirt-cim version < 694

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Mon Nov 10 03:21:54 UTC 2008


# HG changeset patch
# User Deepti B. Kalakeri<deeptik at linux.vnet.ibm.com>
# Date 1226287299 28800
# Node ID 8cb2952f699638eeb78dd49a54bd238153bc6a93
# Parent  6591949e8afdddce6aa72022e33f0ce063ec60a1
[TEST] Fixing 15_mod_system_settings.py tc of VSMS to work with libvirt-cim version < 694.

For libvirt_cim version < 694 , the ret[0] is returning None on successful ModifySystemSettings() call.
For libvirt_cim version > 694, the ret[0] returns 0 on successful ModifySystemSettings() call.

Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>

diff -r 6591949e8afd -r 8cb2952f6996 suites/libvirt-cim/cimtest/VirtualSystemManagementService/15_mod_system_settings.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/15_mod_system_settings.py	Wed Nov 05 22:03:48 2008 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/15_mod_system_settings.py	Sun Nov 09 19:21:39 2008 -0800
@@ -30,6 +30,7 @@ from XenKvmLib.classes import get_typed_
 from XenKvmLib.classes import get_typed_class, inst_to_mof
 from XenKvmLib.enumclass import GetInstance 
 from XenKvmLib.common_util import poll_for_state_change 
+from XenKvmLib.const import get_provider_version
 
 sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
 default_dom = 'rstest_domain'
@@ -37,6 +38,7 @@ RECOVERY_VAL = 3
 RECOVERY_VAL = 3
 DEFINED_STATE = 3
 bug = "00008"
+libvirt_modify_setting_changes = 694
 
 def cleanup_env(ip, cxml):
     cxml.cim_destroy(ip)
@@ -97,10 +99,12 @@ def main():
         vssd = inst_to_mof(inst)
 
         ret = service.ModifySystemSettings(SystemSettings=vssd) 
-        if ret[0] != 0:
-            logger.error("Failed to modify dom: %s", default_dom)
-            cleanup_env(options.ip, cxml)
-            return FAIL
+        curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+        if curr_cim_rev >= libvirt_modify_setting_changes:
+            if ret[0] != 0:
+                logger.error("Failed to modify dom: %s", default_dom)
+                cleanup_env(options.ip, cxml)
+                return FAIL
 
         if case == "start":
             #This should be replaced with a RSC to shutdownt he guest




More information about the Libvirt-cim mailing list