From patchwork Mon Jan 3 18:34:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 448931 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p03IXppf027661 for ; Mon, 3 Jan 2011 18:33:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754860Ab1ACSdo (ORCPT ); Mon, 3 Jan 2011 13:33:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11941 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754742Ab1ACSdn (ORCPT ); Mon, 3 Jan 2011 13:33:43 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p03IXgI9026465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Jan 2011 13:33:42 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p03IXghx023769; Mon, 3 Jan 2011 13:33:42 -0500 Received: from moof.tlv.redhat.com (dhcp-1-185.tlv.redhat.com [10.35.1.185]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p03IXWw1027804; Mon, 3 Jan 2011 13:33:41 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 7/7] [RFC] KVM test: use error.context() in kvm_preprocessing.py Date: Mon, 3 Jan 2011 20:34:11 +0200 Message-Id: <1294079651-21631-7-git-send-email-mgoldish@redhat.com> In-Reply-To: <1294079651-21631-1-git-send-email-mgoldish@redhat.com> References: <1294079651-21631-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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 (demeter1.kernel.org [140.211.167.41]); Mon, 03 Jan 2011 18:33:51 +0000 (UTC) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 5ce0a3b..b7f3154 100644 --- a/client/tests/kvm/kvm_preprocessing.py +++ b/client/tests/kvm/kvm_preprocessing.py @@ -49,7 +49,8 @@ def preprocess_vm(test, params, env, name): @param env: The environment (a dict-like object). @param name: The name of the VM object. """ - logging.debug("Preprocessing VM '%s'..." % name) + error.context("preprocessing '%s'" % name) + vm = env.get_vm(name) if vm: logging.debug("VM object found in environment") @@ -114,7 +115,7 @@ def postprocess_vm(test, params, env, name): @param env: The environment (a dict-like object). @param name: The name of the VM object. """ - logging.debug("Postprocessing VM '%s'..." % name) + error.context("postprocessing '%s'" % name) vm = env.get_vm(name) if vm: logging.debug("VM object found in environment") @@ -196,6 +197,8 @@ def preprocess(test, params, env): @param params: A dict containing all VM and image parameters. @param env: The environment (a dict-like object). """ + error.context("preprocessing") + # Start tcpdump if it isn't already running if "address_cache" not in env: env["address_cache"] = {} @@ -282,6 +285,8 @@ def postprocess(test, params, env): @param params: Dict containing all VM and image parameters. @param env: The environment (a dict-like object). """ + error.context("postprocessing") + # Postprocess all VMs and images process(test, params, env, postprocess_image, postprocess_vm)