From patchwork Sat May 21 04:23:28 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: 805212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4L4NaTt001173 for ; Sat, 21 May 2011 04:23:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751289Ab1EUEXc (ORCPT ); Sat, 21 May 2011 00:23:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61341 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926Ab1EUEXb (ORCPT ); Sat, 21 May 2011 00:23:31 -0400 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.14.4/8.14.4) with ESMTP id p4L4NUB3007503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 21 May 2011 00:23:30 -0400 Received: from freedom.redhat.com (vpn-9-106.rdu.redhat.com [10.11.9.106]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4L4NMqs010171; Sat, 21 May 2011 00:23:28 -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: Sat, 21 May 2011 01:23:28 -0300 Message-Id: <1305951810-5933-4-git-send-email-lmr@redhat.com> In-Reply-To: <1305951810-5933-1-git-send-email-lmr@redhat.com> References: <1305951810-5933-1-git-send-email-lmr@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.6 (demeter2.kernel.org [140.211.167.43]); Sat, 21 May 2011 04:23:36 +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): """