Skip to content

Commit

Permalink
tests: Make OVS_APP_EXIT_AND_WAIT() wait for process termination
Browse files Browse the repository at this point in the history
Currently OVS_APP_EXIT_AND_WAIT() only waits for the pid file
to be removed.  When using gcov (and likely other utilities),
we need to ensure that the application has actually exited.

Also adding AT_CHECK() around the exit request to allow simplification
of tests using open-coded versions of this macro.

Signed-off-by: Lance Richardson <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
hlrichardson authored and blp committed Mar 18, 2016
1 parent 685f4df commit f9b11f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/ovs-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ dnl
dnl Ask the daemon named DAEMON to exit, via ovs-appctl, and then waits for it
dnl to exit.
m4_define([OVS_APP_EXIT_AND_WAIT],
[ovs-appctl -t $1 exit
OVS_WAIT_WHILE([test -e $1.pid])])
[TMPPID=`cat "$OVS_RUNDIR"/$1.pid 2>/dev/null`
AT_CHECK([ovs-appctl -t $1 exit])
OVS_WAIT_WHILE([kill -0 $TMPPID 2>/dev/null])])

dnl on_exit "COMMAND"
dnl
Expand Down

0 comments on commit f9b11f2

Please sign in to comment.