From patchwork Tue Mar 23 19:10:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 87747 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2NJBLp7032583 for ; Tue, 23 Mar 2010 19:11:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753791Ab0CWTLT (ORCPT ); Tue, 23 Mar 2010 15:11:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65491 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752510Ab0CWTLR (ORCPT ); Tue, 23 Mar 2010 15:11:17 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2NJBFej016180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Mar 2010 15:11:16 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2NJBFqM012337; Tue, 23 Mar 2010 15:11:15 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o2NJB3OI015534; Tue, 23 Mar 2010 15:11:14 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 5/5] KVM test: abort-on-error mode Date: Tue, 23 Mar 2010 21:10:01 +0200 Message-Id: <1269371401-9341-5-git-send-email-mgoldish@redhat.com> In-Reply-To: <1269371401-9341-4-git-send-email-mgoldish@redhat.com> References: <1269371401-9341-1-git-send-email-mgoldish@redhat.com> <1269371401-9341-2-git-send-email-mgoldish@redhat.com> <1269371401-9341-3-git-send-email-mgoldish@redhat.com> <1269371401-9341-4-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 23 Mar 2010 19:11:22 +0000 (UTC) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index b3fef9d..50db65c 100644 --- a/client/tests/kvm/kvm_preprocessing.py +++ b/client/tests/kvm/kvm_preprocessing.py @@ -347,6 +347,19 @@ def postprocess(test, params, env): int(params.get("post_command_timeout", "600")), params.get("post_command_noncritical") == "yes") + # Abort on error? + if params.get("abort") == "yes": + exc_string = str(sys.exc_info()[1]) + logging.info("Aborting job (%s)", exc_string) + for vm in kvm_utils.env_get_all_vms(env): + if not vm.is_dead(): + logging.info("VM '%s' is alive.", vm.name) + logging.info("The monitor unix socket of '%s' is: %s", + vm.name, vm.monitor_file_name) + logging.info("The command line used to start '%s' was:\n%s", + vm.name, vm.make_qemu_command()) + raise error.JobError("Abort requested (%s)" % exc_string) + def postprocess_on_error(test, params, env): """ diff --git a/client/tests/kvm/tests.cfg.sample b/client/tests/kvm/tests.cfg.sample index b86b6c4..2c17454 100644 --- a/client/tests/kvm/tests.cfg.sample +++ b/client/tests/kvm/tests.cfg.sample @@ -74,5 +74,10 @@ variants: only Fedora.12.64 only unattended_install boot shutdown +# Uncomment the following lines to enable abort-on-error mode: +#abort_on_error = yes +#kill_vm.* ?= no +#kill_unresponsive_vms.* ?= no + # Choose your test list from the testsets defined only qemu_kvm_f12_quick