From patchwork Tue May 24 07:03:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 811022 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 p4O73Q4Y025252 for ; Tue, 24 May 2011 07:03:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753359Ab1EXHDW (ORCPT ); Tue, 24 May 2011 03:03:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30508 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049Ab1EXHDV (ORCPT ); Tue, 24 May 2011 03:03:21 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4O73KDt005064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 24 May 2011 03:03:20 -0400 Received: from freedom.redhat.com (vpn-9-252.rdu.redhat.com [10.11.9.252]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4O73CFw006920; Tue, 24 May 2011 03:03:19 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH 3/5] KVM test: virt_env_process: Setup private bridge during postprocessing Date: Tue, 24 May 2011 04:03:18 -0300 Message-Id: <1306220600-3840-4-git-send-email-lmr@redhat.com> In-Reply-To: <1306220600-3840-1-git-send-email-lmr@redhat.com> References: <1306220600-3840-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 24 May 2011 07:03:27 +0000 (UTC) Call bridge setup at preprocessing and cleanup at postprocessing. The bridge can be cleaned up when no tap interfaces are using it. Signed-off-by: Lucas Meneghel Rodrigues --- client/virt/virt_env_process.py | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py index 625b422..1742a02 100644 --- a/client/virt/virt_env_process.py +++ b/client/virt/virt_env_process.py @@ -196,6 +196,11 @@ def preprocess(test, params, env): @param env: The environment (a dict-like object). """ error.context("preprocessing") + + if params.get("bridge") == "private": + brcfg = virt_test_setup.PrivateBridgeConfig(params) + brcfg.setup() + # Start tcpdump if it isn't already running if "address_cache" not in env: env["address_cache"] = {} @@ -365,6 +370,10 @@ def postprocess(test, params, env): int(params.get("post_command_timeout", "600")), params.get("post_command_noncritical") == "yes") + if params.get("bridge") == "private": + brcfg = virt_test_setup.PrivateBridgeConfig() + brcfg.cleanup() + def postprocess_on_error(test, params, env): """