aboutsummaryrefslogtreecommitdiff
path: root/tests/ovs-xapi-sync.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-08-20 10:29:39 -0700
committerBen Pfaff <blp@nicira.com>2012-08-20 12:28:05 -0700
commit0b7140bbc55768f9f1d12f2cc42fa29c5fa98483 (patch)
tree3960faed9774ead134fc8240dd47a4c7a77923a1 /tests/ovs-xapi-sync.at
parent1e95906159ad032be97a2122e9816b85bdc4ab32 (diff)
tests: New m4 macro ON_EXIT to add a cleanup action.
Several of the tests start daemons and then need to make sure that the daemons get killed when the test completes, even if it completes in the middle due to an early failure. Until now, they have been using manual shell "trap" calls to do this. This works well enough for simple cases, but sometimes multiple macros start daemons in a single test, and then each "trap" has to be carefully written to kill off the daemons for the previously invoked macros. This commit introduces a new macro ON_EXIT whose use is composable: each call appends a new action to the ones already specified. Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tests/ovs-xapi-sync.at')
-rw-r--r--tests/ovs-xapi-sync.at2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ovs-xapi-sync.at b/tests/ovs-xapi-sync.at
index 25acc7437..29d47379b 100644
--- a/tests/ovs-xapi-sync.at
+++ b/tests/ovs-xapi-sync.at
@@ -16,7 +16,7 @@ cp "$top_srcdir/vswitchd/vswitch.ovsschema" .
cp "$top_srcdir/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync" \
ovs-xapi-sync
-trap 'kill `cat pid ovs-xapi-sync.pid`' 0
+ON_EXIT([kill `cat pid ovs-xapi-sync.pid`])
mkdir var var/run
touch var/run/xapi_init_complete.cookie