From e2b553e49b040303d9cc61633e10470f0098672e Mon Sep 17 00:00:00 2001 From: Andy Zhou Date: Thu, 5 Feb 2015 15:19:41 -0800 Subject: [PATCH] test: remove namespace after ovs-vswitchd is stopped Remove namespaces also removes the ports in them, thus may causing vswitch to generate warning log messages about not being able find the port before it exits. Remove namespaces after ovs-vswitchd exits improves test reliability. Signed-off-by: Andy Zhou Signed-off-by: Joe Stringer --- tests/kmod-macros.at | 7 ++++++- tests/kmod-traffic.at | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/kmod-macros.at b/tests/kmod-macros.at index f3629bc60..9369cc1f4 100644 --- a/tests/kmod-macros.at +++ b/tests/kmod-macros.at @@ -15,7 +15,7 @@ m4_define([OVS_KMOD_VSWITCHD_START], ]) # # -# OVS_KMOD_VSWITCHD_STOP([WHITELIST]) +# OVS_KMOD_VSWITCHD_STOP([WHITELIST], [extra_cmds]) # # Gracefully stops ovs-vswitchd and ovsdb-server, checking their log files # for messages with severity WARN or higher and signaling an error if any @@ -23,9 +23,14 @@ m4_define([OVS_KMOD_VSWITCHD_START], # commands to delete any warnings that are actually expected, e.g.: # # OVS_KMOD_VSWITCHD_STOP(["/expected error/d"]) +# +# 'extra_cmds' are shell commands to be executed afte OVS_VSWITCHD_STOP() is +# invoked. They can be used to perform additional cleanups such as name space +# removal. m4_define([OVS_KMOD_VSWITCHD_STOP], [AT_CHECK([ovs-vsctl del-br br0]) OVS_VSWITCHD_STOP([$1]) + AT_CHECK([:; $2]) AT_CHECK([modprobe -r openvswitch]) ]) diff --git a/tests/kmod-traffic.at b/tests/kmod-traffic.at index 685e1af8a..34e50625d 100644 --- a/tests/kmod-traffic.at +++ b/tests/kmod-traffic.at @@ -11,6 +11,5 @@ ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24") AT_CHECK([ip netns exec at_ns0 bash -c "ping -q -c 3 -i 0.3 -w 2 10.1.1.2 >/dev/null"]) -DEL_NAMESPACES(at_ns0, at_ns1) -OVS_KMOD_VSWITCHD_STOP +OVS_KMOD_VSWITCHD_STOP([], DEL_NAMESPACES(at_ns0, at_ns1)) AT_CLEANUP -- 2.20.1