From patchwork Thu Jun 2 04:23:07 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: 842652 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 p524VU7l006572 for ; Thu, 2 Jun 2011 04:31:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752058Ab1FBEXa (ORCPT ); Thu, 2 Jun 2011 00:23:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11918 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751847Ab1FBEX3 (ORCPT ); Thu, 2 Jun 2011 00:23:29 -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.14.4/8.14.4) with ESMTP id p524NSXh000371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Jun 2011 00:23:29 -0400 Received: from justice.redhat.com (vpn-11-207.rdu.redhat.com [10.11.11.207]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p524NBpw014756; Thu, 2 Jun 2011 00:23:24 -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: Thu, 2 Jun 2011 01:23:07 -0300 Message-Id: <1306988589-17085-4-git-send-email-lmr@redhat.com> In-Reply-To: <1306988589-17085-1-git-send-email-lmr@redhat.com> References: <1306988589-17085-1-git-send-email-lmr@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.6 (demeter2.kernel.org [140.211.167.43]); Thu, 02 Jun 2011 04:31:31 +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): """