[PATCH] [TEST] Fix CS 34 to SKIP if virt type is KVM and providers are old

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1257801892 28800 # Node ID 72072bf8e9b0511d69dc308f2174dea3cb797a6c # Parent 55c3c3f3bc77c9946f61997de87547e99c21e38a [TEST] 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). Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 55c3c3f3bc77 -r 72072bf8e9b0 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,16 @@ 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 + + status = cxml.check_guest_state(server, exp_state) cxml = get_class(virt)(default_dom) ret = cxml.cim_define(server) if not ret: @@ -67,12 +77,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" % \
participants (1)
-
Kaitlin Rupert