From 071ceb1e97e00d3d110f38f240b15ba90384a5dd Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 15 Nov 2002 01:20:28 +0000 Subject: [PATCH] Better cleanup; reduce filename conflict * Makefile.in (unit-test-ok): Depend only on unit-test-body. (unit-test-body): Remove krb5cc_rpc_test_* on entry and on successful exit. On error exit, let the trap handler do all the cleanup. Incorporate old unit-test-setup commands. (unit-test-setup, unit-test-cleanup): Targets deleted. * lib/helpers.exp (start_client, wait_client): Set KRB5CCNAME to something in the current directory. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15002 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/unit-test/ChangeLog | 10 ++++++++++ src/lib/rpc/unit-test/Makefile.in | 22 ++++++++++------------ src/lib/rpc/unit-test/lib/helpers.exp | 4 ++-- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/lib/rpc/unit-test/ChangeLog b/src/lib/rpc/unit-test/ChangeLog index f5b2759b9..3df87ebf4 100644 --- a/src/lib/rpc/unit-test/ChangeLog +++ b/src/lib/rpc/unit-test/ChangeLog @@ -1,3 +1,13 @@ +2002-11-14 Ken Raeburn + + * Makefile.in (unit-test-ok): Depend only on unit-test-body. + (unit-test-body): Remove krb5cc_rpc_test_* on entry and on + successful exit. On error exit, let the trap handler do all the + cleanup. Incorporate old unit-test-setup commands. + (unit-test-setup, unit-test-cleanup): Targets deleted. + * lib/helpers.exp (start_client, wait_client): Set KRB5CCNAME to + something in the current directory. + 2002-11-11 Ken Raeburn * Makefile.in (unit-test-body): Set RPC_TEST_SRVTAB based on diff --git a/src/lib/rpc/unit-test/Makefile.in b/src/lib/rpc/unit-test/Makefile.in index f223432b1..a9ed5c3d7 100644 --- a/src/lib/rpc/unit-test/Makefile.in +++ b/src/lib/rpc/unit-test/Makefile.in @@ -42,27 +42,25 @@ unit-test-: @echo "+++ Either tcl, runtest, or Perl is unavailable." @echo "+++" -unit-test-ok:: unit-test-setup unit-test-body unit-test-cleanup +unit-test-ok:: unit-test-body PASS=@PASS@ unit-test-body: + $(RM) krb5cc_rpc_test_* + $(ENV_SETUP) $(START_SERVERS) RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab.$$$$ ; export RPC_TEST_SRVTAB ; \ - trap "rm -f $$RPC_TEST_SRVTAB ; exit 1" 0 1 2 3 14 15 ; \ + trap "echo Failed, cleaning up... ; rm -f $$RPC_TEST_SRVTAB ; $(ENV_SETUP) $(STOP_SERVERS) ; trap '' 0 ; exit 1" 0 1 2 3 14 15 ; \ if $(ENV_SETUP) \ $(RUNTEST) SERVER=./server CLIENT=./client \ KINIT=$(BUILDTOP)/clients/kinit/kinit \ KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \ PASS="$(PASS)" --tool rpc_test $(RUNTESTFLAGS) ; \ - then rm -f $$RPC_TEST_SRVTAB ; trap 0 ; exit 0 ; \ - else rm -f $$RPC_TEST_SRVTAB ; exit 1 ; fi - -unit-test-setup:: - $(ENV_SETUP) $(START_SERVERS) -# RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab $(ENV_SETUP) $(srcdir)/rpc_test_setup.sh - -unit-test-cleanup:: - $(ENV_SETUP) $(STOP_SERVERS) -# -rm -f /tmp/rpc_test_v5srvtab /tmp/krb5cc_rpc_test_fullrun + then \ + echo Cleaning up... ; \ + rm -f $$RPC_TEST_SRVTAB krb5cc_rpc_test_* ; \ + $(ENV_SETUP) $(STOP_SERVERS) ; \ + trap 0 ; exit 0 ; \ + else exit 1 ; fi clean:: $(RM) server client diff --git a/src/lib/rpc/unit-test/lib/helpers.exp b/src/lib/rpc/unit-test/lib/helpers.exp index 9d6cfc69c..54e0ef430 100644 --- a/src/lib/rpc/unit-test/lib/helpers.exp +++ b/src/lib/rpc/unit-test/lib/helpers.exp @@ -171,7 +171,7 @@ proc start_client {testname ccname user password lifetime count set target "server@$hostname" } - set env(KRB5CCNAME) FILE:/tmp/krb5cc_rpc_test_$ccname + set env(KRB5CCNAME) FILE:[pwd]/krb5cc_rpc_test_$ccname kinit $user $password $lifetime if {$verbose > 0} { @@ -219,7 +219,7 @@ proc wait_client {testname ccname id status} { } } - set env(KRB5CCNAME) FILE:/tmp/krb5cc_rpc_test_$ccname + set env(KRB5CCNAME) FILE:[pwd]/krb5cc_rpc_test_$ccname if {[catch "exec $kdestroy -5"] != 0} { perror "$testname: cannot destroy client $ccname ccache" } -- 2.26.2