tests: New m4 macro ON_EXIT to add a cleanup action.
authorBen Pfaff <blp@nicira.com>
Mon, 20 Aug 2012 17:29:39 +0000 (10:29 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 20 Aug 2012 19:28:05 +0000 (12:28 -0700)
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>

No differences found