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 <az...@nicira.com> --- 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 f3629bc..86f1cef 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,10 +23,15 @@ 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([modprobe -r openvswitch]) + AT_CHECK([:; $2]) ]) # DEL_NAMESPACES(ns [, ns ... ]) diff --git a/tests/kmod-traffic.at b/tests/kmod-traffic.at index 685e1af..34e5062 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 -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev