# HG changeset patch
# User Kaitlin Rupert <karupert(a)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(a)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" % \