[ovs-dev] [PATCH 2/2] test: Hide the name space clean up inside ADD_NAMESPACE macro

Andy Zhou azhou at nicira.com
Sat Feb 7 00:31:35 UTC 2015


To reduce the complexity of writing kmod tests.

Suggested-by: Joe Stringer <joestringer at nicira.com>
Signed-off-by: Andy Zhou <azhou at nicira.com>
---
 tests/kmod-macros.at  | 1 +
 tests/kmod-traffic.at | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/kmod-macros.at b/tests/kmod-macros.at
index 1281e25..5824940 100644
--- a/tests/kmod-macros.at
+++ b/tests/kmod-macros.at
@@ -53,6 +53,7 @@ m4_define([ADD_NAMESPACES],
    [m4_foreach([ns], [$@],
                [DEL_NAMESPACES(ns)
                 AT_CHECK([ip netns add ns])
+                ON_EXIT(DEL_NAMESPACES(ns))
                ])
    ]
 )
diff --git a/tests/kmod-traffic.at b/tests/kmod-traffic.at
index bcc4c17..f7783be 100644
--- a/tests/kmod-traffic.at
+++ b/tests/kmod-traffic.at
@@ -5,7 +5,6 @@ OVS_KMOD_VSWITCHD_START(
    [set-fail-mode br0 standalone -- ])
 
 ADD_NAMESPACES(at_ns0, at_ns1)
-ON_EXIT(DEL_NAMESPACES(at_ns0, at_ns1))
 
 ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
 ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
-- 
1.9.1




More information about the dev mailing list