[ovs-dev] [PATCH] testsuite: exit gracefully if it fails.

Flavio Leitner fbl at redhat.com
Thu Jun 8 17:30:48 UTC 2017


The daemon is killed leaving resources behind when a test fails.
This fixes to first signal the daemon to exit gracefully.

Suggested-by: Joe Stringer <joe at ovn.org>
Fixes: 0f28164be02ac ("netdev-linux: make tap devices persistent")
Signed-off-by: Flavio Leitner <fbl at redhat.com>
---
 tests/ofproto-macros.at | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index faff5b0..5ac5d05 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -323,6 +323,9 @@ m4_define([_OVS_VSWITCHD_START],
    AT_CHECK([ovs-vswitchd $1 --detach --no-chdir --pidfile --log-file -vvconn -vofproto_dpif -vunixctl], [0], [], [stderr])
    AT_CAPTURE_FILE([ovs-vswitchd.log])
    on_exit "kill `cat ovs-vswitchd.pid`"
+   dnl Wait for the daemon to exit gracefully
+   on_exit "for i in 1 2 3 4 5 6 7 8 9; do kill -0 `cat ovs-vswitchd.pid` || break; sleep 0.1 || sleep 1; done"
+   on_exit "ovs-appctl -t ovs-vswitchd exit --cleanup"
    AT_CHECK([[sed < stderr '
 /ovs_numa|INFO|Discovered /d
 /vlog|INFO|opened log file/d
-- 
2.9.4



More information about the dev mailing list