diff mbox

[3/5] KVM test: virt_env_process: Setup private bridge during postprocessing

Message ID 1306220600-3840-4-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues May 24, 2011, 7:03 a.m. 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 <lmr@redhat.com>
---
 client/virt/virt_env_process.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff mbox

Patch

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):
     """