summaryrefslogtreecommitdiff
path: root/tests/ovs-macros.at
diff options
context:
space:
mode:
authorLance Richardson <lrichard@redhat.com>2016-03-02 16:40:45 -0500
committerBen Pfaff <blp@ovn.org>2016-03-18 16:53:11 -0700
commitf9b11f2a09b45c87995d69588fc0a9f03661725e (patch)
tree8715405d13bb11e94215b1770b6f0f50fa5d4c01 /tests/ovs-macros.at
parent685f4dfe09f2b0ed859dfcbc7e454c6f7196cefb (diff)
downloadopenvswitch-f9b11f2a09b45c87995d69588fc0a9f03661725e.tar.gz
tests: Make OVS_APP_EXIT_AND_WAIT() wait for process termination
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 <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests/ovs-macros.at')
-rw-r--r--tests/ovs-macros.at5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index f2923b0f8..dc7b700f7 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -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