[Libvirt-cim] [PATCH] [TEST] #2 Fix CS 34 to SKIP if virt type is KVM and providers are old

Sharad Mishra snmishra at us.ibm.com
Wed Nov 18 21:43:08 UTC 2009


+1

Sharad Mishra
System x Enablement
Linux Technology Center
IBM


                                                                           
             Kaitlin Rupert                                                
             <kaitlin at linux.vn                                             
             et.ibm.com>                                                To 
             Sent by:                  libvirt-cim at redhat.com              
             libvirt-cim-bounc                                          cc 
             es at redhat.com                                                 
                                                                   Subject 
                                       [Libvirt-cim] [PATCH] [TEST] #2 Fix 
             11/10/2009 09:07          CS 34 to SKIP if virt type is       
             AM                        KVM and providers are old           
                                                                           
                                                                           
             Please respond to                                             
                 List for                                                  
              discussion and                                               
              development of                                               
                libvirt CIM                                                
             <libvirt-cim at redh                                             
                  at.com>                                                  
                                                                           
                                                                           




# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1257801892 28800
# Node ID 2f8394bb8f38f72069871e1ce07214f1abc6b2cc
# Parent  55c3c3f3bc77c9946f61997de87547e99c21e38a
[TEST] #2 Fix CS 34 to SKIP if virt type is KVM and providers are old...

When they are older than revision 945.

The cimtest image doesn't support reboot; older versions of libvirt-cim
attempted to reboot guests on a disable call (instead of powering them down
immediately).  This fix does a virsh destroy on the guest (for older
provider
sets only).

Updates:
 -Copy and paste error.  Remove extraneous line.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 55c3c3f3bc77 -r 2f8394bb8f38
suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py
 Tue Nov 03 10:37:35 2009 -0800
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py
 Mon Nov 09 13:24:52 2009 -0800
@@ -37,7 +37,7 @@
 from CimTest.Globals import logger
 from XenKvmLib.const import do_main, CIM_ENABLE, CIM_DISABLE, \
                             get_provider_version
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, SKIP
 from XenKvmLib.vxml import get_class

 sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
@@ -54,6 +54,15 @@
     virt   = options.virt

     try:
+        rev, changeset = get_provider_version(virt, server)
+        if rev >= disable_change_rev:
+            exp_state = CIM_DISABLE
+        else:
+            if options.virt == "KVM":
+                logger.info("cimtest's KVM guest imagedoesn't support
reboot")
+                return SKIP
+            exp_state = CIM_ENABLE
+
         cxml = get_class(virt)(default_dom)
         ret = cxml.cim_define(server)
         if not ret:
@@ -67,12 +76,6 @@
         if status != PASS:
             raise Exception("Unable disable dom '%s'" % default_dom)

-        rev, changeset = get_provider_version(virt, server)
-        if rev >= disable_change_rev:
-            exp_state = CIM_DISABLE
-        else:
-            exp_state = CIM_ENABLE
-
         status = cxml.check_guest_state(server, exp_state)
         if status != PASS:
             raise Exception("%s not in expected state %d" % \

_______________________________________________
Libvirt-cim mailing list
Libvirt-cim at redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091118/b0863a73/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091118/b0863a73/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic23234.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091118/b0863a73/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091118/b0863a73/attachment-0002.gif>


More information about the Libvirt-cim mailing list