Executing clean-up commands in the reverse order of their addition
seems to be better for most of the cleanup situations. For example,
in kmod tests, we should remove name spaces before remove kernel
modules.

Signed-off-by: Andy Zhou <az...@nicira.com>
---
 tests/ovs-macros.at | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index 0581512..4a3d552 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -92,7 +92,6 @@ dnl Adds the shell COMMANDS to a collection executed when the 
current test
 dnl completes, as a cleanup action.  (The most common use is to kill a
 dnl daemon started by the test.  This is important to prevent tests that
 dnl start daemons from hanging at exit.)
-m4_define([ON_EXIT], [trap '. ./cleanup' 0; cat >>cleanup <<'EOF'
-$1
-EOF
+dnl The commands will be added will be tht first one to excute.
+m4_define([ON_EXIT], [trap '. ./cleanup' 0; (echo '$1'; cat cleanup) > 
__cleanup; mv __cleanup cleanup
 ])
-- 
1.9.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to