Better cleanup; reduce filename conflict
authorKen Raeburn <raeburn@mit.edu>
Fri, 15 Nov 2002 01:20:28 +0000 (01:20 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 15 Nov 2002 01:20:28 +0000 (01:20 +0000)
* 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
src/lib/rpc/unit-test/Makefile.in
src/lib/rpc/unit-test/lib/helpers.exp

index f5b2759b96b83b471e1ea119408765ae79d74195..3df87ebf4621bafa24608fa15312791cd70f8071 100644 (file)
@@ -1,3 +1,13 @@
+2002-11-14  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * Makefile.in (unit-test-body): Set RPC_TEST_SRVTAB based on
index f223432b17f903fd90e859629fcab234b921387d..a9ed5c3d7ccf226ada1f4933a9e8c7261b4391ef 100644 (file)
@@ -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
index 9d6cfc69c81ff5fe439e43cee542663c7a0eab96..54e0ef4301f8b0a128ff9fce3274e38a32f16461 100644 (file)
@@ -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"
        }