* env-setup.shin: Renamed env-setup.sh for autoconf use
authorEzra Peisach <epeisach@mit.edu>
Thu, 3 Oct 1996 17:26:08 +0000 (17:26 +0000)
committerEzra Peisach <epeisach@mit.edu>
Thu, 3 Oct 1996 17:26:08 +0000 (17:26 +0000)
* init_db, start_servers, start_servers_local, stop_servers:
Invoke scripts from source directory or build tree as needed.

* configure.in, Makefile.in: generate env-setup.sh with proper
paths already.

(env-setup.shin was created - retaining the old history logs)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9138 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/testing/scripts/ChangeLog
src/kadmin/testing/scripts/Makefile.in
src/kadmin/testing/scripts/configure.in
src/kadmin/testing/scripts/env-setup.sh [deleted file]
src/kadmin/testing/scripts/env-setup.shin
src/kadmin/testing/scripts/init_db
src/kadmin/testing/scripts/start_servers
src/kadmin/testing/scripts/start_servers_local
src/kadmin/testing/scripts/stop_servers

index aab2e1e5a4c2d89bcca5dd187f5b6c17b6256b5d..8b71e49980f91da130d6a0e1f3f4b7945faab1e4 100644 (file)
@@ -1,3 +1,14 @@
+Thu Oct  3 13:16:19 1996  Ezra Peisach  <epeisach@kangaroo.mit.edu>
+
+       * env-setup.shin: Renamed env-setup.sh for autoconf use.
+
+       * init_db, start_servers, start_servers_local, stop_servers:
+               Invoke scripts from source directory or build tree as needed.
+
+       * configure.in, Makefile.in: generate env-setup.sh with proper
+               paths already.
+
+
 Wed Oct  2 13:41:04 1996  Ezra Peisach  <epeisach@kangaroo.mit.edu>
 
        * configure.in, Makefile.in: Let autoconf determine path to perl.
index 33297520e06f2d9f0cf110a6587e8cb2f40a5c67..b354c401e4f3567a840ed99ecc0bab0ebd3422bb 100644 (file)
@@ -3,11 +3,19 @@ PERL=@PERL@
 GEN_SCRIPTS = compare_dump.pl fixup-conf-files.pl make-host-keytab.pl \
        simple_dump.pl verify_xrunner_report.pl qualname.pl
 
-all:: $(GEN_SCRIPTS) restore_files.sh
+all:: env-setup.sh $(GEN_SCRIPTS) restore_files.sh 
+
+# Should only rebuild env_setup.sh here (use CONFIG_FILES=), but the weird krb5
+# makefile post-processing is unconditional and would trash the makefile.
+env-setup.sh: env-setup.stamp
+env-setup.stamp: $(srcdir)/env-setup.shin config.status
+       $(SHELL) config.status
+       chmod +x env-setup.sh
+       touch env-setup.stamp
 
 restore_files.sh:
        rm -f restore_files.sh
-       ln -s save_files.sh restore_files.sh
+       ln -s $(srcdir)/save_files.sh restore_files.sh
 
 %.pl: %.pl.in
        -rm -f $@.tmp
@@ -17,4 +25,4 @@ restore_files.sh:
        mv $@.tmp $@
 
 clean::
-       -rm -f $(GEN_SCRIPTS) *.tmp
+       -rm -f $(GEN_SCRIPTS) *.tmp env-setup.sh env-setup.stamp restore_files.sh
index c035622dd1b79c7e0cbf6f768d2d6ac560bc7017..def89da6749cee6966df2ff78dc9bd61df05f9b9 100644 (file)
@@ -1,4 +1,7 @@
 AC_INIT(init_db)
 CONFIG_RULES
 AC_PATH_PROG(PERL,perl)
-V5_AC_OUTPUT_MAKEFILE
+dnl The following are substituted into env-setup.sh
+AC_SUBST(BUILDTOP)
+AC_SUBST(SRCTOP)
+V5_AC_OUTPUT_MAKEFILE( ,env-setup.sh:env-setup.shin)
diff --git a/src/kadmin/testing/scripts/env-setup.sh b/src/kadmin/testing/scripts/env-setup.sh
deleted file mode 100644 (file)
index 4ae1147..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-#
-# The KADM5 unit tests were developed to work under gmake.  As a
-# result, they expect to inherit a number of environment variables.
-# Rather than rewrite the tests, we simply use this script as an
-# execution wrapper that sets all the necessary environment variables
-# before running the program specified on its command line.
-#
-# The variable settings all came from OV's config.mk.
-#
-# Usage: env-setup.sh <command line>
-#
-
-if [ "$TOP" = "" ]; then
-       echo "Error! \$TOP is not set."
-       exit 1
-fi
-
-TESTDIR=$TOP/testing; export TESTDIR
-if [ "$K5ROOT" = "" ]; then
-       K5ROOT="`cd $TESTDIR; pwd`/krb5-test-root"
-       export K5ROOT
-fi
-
-REALM=SECURE-TEST.OV.COM; export REALM
-
-# XXX This should be detected by configure!
-EXPECT=/mit/gnu/bin/expect; export EXPECT
-
-COMPARE_DUMP=$TESTDIR/scripts/compare_dump.pl; export COMPARE_DUMP
-FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl
-export FIX_CONF_FILES
-INITDB=$TESTDIR/scripts/init_db; export INITDB
-MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl; export MAKE_KEYTAB
-LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl
-export LOCAL_MAKE_KEYTAB
-RESTORE_FILES=$TESTDIR/scripts/restore_files.sh; export RESTORE_FILES
-SAVE_FILES=$TESTDIR/scripts/save_files.sh; export SAVE_FILES
-SIMPLE_DUMP=$TESTDIR/scripts/simple_dump.pl; export SIMPLE_DUMP
-TCLUTIL=$TESTDIR/tcl/util.t; export TCLUTIL
-BSDDB_DUMP=$TESTDIR/util/bsddb_dump; export BSDDB_DUMP
-CLNTTCL=$TESTDIR/util/ovsec_kadm_clnt_tcl; export CLNTTCL
-SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl; export SRVTCL
-QUALNAME=$TOP/inst-scripts/qualname.pl; export QUALNAME
-
-KRB5_CONFIG=$K5ROOT/krb5.conf; export KRB5_CONFIG
-KRB5_KDC_PROFILE=$K5ROOT/kdc.conf; export KRB5_KDC_PROFILE
-KRB5_KTNAME=$K5ROOT/ovsec_adm.srvtab; export KRB5_KTNAME
-
-if [ "$TEST_SERVER" != "" ]; then
-       MAKE_KEYTAB="$MAKE_KEYTAB -server $TEST_SERVER"
-fi
-if [ "$TEST_PATH" != "" ]; then
-       MAKE_KEYTAB="$MAKE_KEYTAB -top $TEST_PATH"
-fi
-
-if [ "x$PS_ALL" = "x" ]; then
-       ps -axwwu >/dev/null 2>&1
-       ps_bsd=$?
-
-       ps -ef >/dev/null 2>&1
-       ps_sysv=$?
-
-       if [ $ps_bsd = 0 -a $ps_sysv = 1 ]; then
-               PS_ALL="ps -auxww"
-               PS_PID="ps -auxww"
-       elif [ $ps_bsd = 1 -a $ps_sysv = 0 ]; then
-               PS_ALL="ps -ef"
-               PS_PID="ps -fp"
-       else
-               PS_ALL="ps -auxww"
-               PS_PID="ps -auxww"
-               echo "WARNING!  Cannot auto-detect ps type, assuming BSD."
-       fi
-
-       export PS_ALL PS_PID
-fi
-
-exec ${1+"$@"}
index 4ae11471eeea6c9c689fa3d8b0b58204e1e92b1e..2c61cc4284912f304f1644d9e17c63807c2340cb 100644 (file)
 # Usage: env-setup.sh <command line>
 #
 
-if [ "$TOP" = "" ]; then
-       echo "Error! \$TOP is not set."
-       exit 1
-fi
+TOP=@BUILDTOP@/kadmin
+STOP=@SRCTOP@/kadmin
+export TOP
+export STOP
 
 TESTDIR=$TOP/testing; export TESTDIR
+STESTDIR=$STOP/testing; export STESTDIR
 if [ "$K5ROOT" = "" ]; then
        K5ROOT="`cd $TESTDIR; pwd`/krb5-test-root"
        export K5ROOT
@@ -30,14 +31,14 @@ EXPECT=/mit/gnu/bin/expect; export EXPECT
 COMPARE_DUMP=$TESTDIR/scripts/compare_dump.pl; export COMPARE_DUMP
 FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl
 export FIX_CONF_FILES
-INITDB=$TESTDIR/scripts/init_db; export INITDB
+INITDB=$STESTDIR/scripts/init_db; export INITDB
 MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl; export MAKE_KEYTAB
 LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl
 export LOCAL_MAKE_KEYTAB
 RESTORE_FILES=$TESTDIR/scripts/restore_files.sh; export RESTORE_FILES
-SAVE_FILES=$TESTDIR/scripts/save_files.sh; export SAVE_FILES
+SAVE_FILES=$STESTDIR/scripts/save_files.sh; export SAVE_FILES
 SIMPLE_DUMP=$TESTDIR/scripts/simple_dump.pl; export SIMPLE_DUMP
-TCLUTIL=$TESTDIR/tcl/util.t; export TCLUTIL
+TCLUTIL=$STESTDIR/tcl/util.t; export TCLUTIL
 BSDDB_DUMP=$TESTDIR/util/bsddb_dump; export BSDDB_DUMP
 CLNTTCL=$TESTDIR/util/ovsec_kadm_clnt_tcl; export CLNTTCL
 SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl; export SRVTCL
index 4b4d9548502e65da44488ef7d3ddc787910e8c4a..c44a9760a0c90cbbf0b4cb34f4ad744e555817c5 100644 (file)
@@ -18,6 +18,11 @@ if [ "$TOP" = "" ]; then
        exit 1
 fi
 
+if [ "$STOP" = "" ]; then
+       echo "init_db: Environment variable \$STOP must point to top of source tree" 1>&2
+       exit 1
+fi
+
 IROOT=$TOP/..
 ADMIN=$TOP/dbutil
 BIN=$IROOT/bin
@@ -26,8 +31,9 @@ SBIN=$TOP/keytab:$TOP/server
 DUMMY=${REALM=SECURE-TEST.OV.COM}; export REALM
 
 DUMMY=${TESTDIR=$TOP/testing}; export TESTDIR
+DUMMY=${STESTDIR=$STOP/testing}
 DUMMY=${SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl}; export SRVTCL
-DUMMY=${TCLUTIL=$TESTDIR/tcl/util.t}; export TCLUTIL
+DUMMY=${TCLUTIL=$STESTDIR/tcl/util.t}; export TCLUTIL
 DUMMY=${LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl}
 
 PATH=$ADMIN:$BIN:$ETC:$SBIN:$PATH; export PATH
@@ -52,13 +58,13 @@ fi
 
 sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \
        -e "s/__KDCHOST__/localhost/g" \
-       < $TESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
+       < $STESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
 sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \
-       < $TESTDIR/proto/kdc.conf.proto > $K5ROOT/kdc.conf
+       < $STESTDIR/proto/kdc.conf.proto > $K5ROOT/kdc.conf
 
 kdb5_util -r $REALM create -P mrroot -s $REDIRECT
 
-cp $TESTDIR/proto/ovsec_adm.dict $K5ROOT/ovsec_adm.dict
+cp $STESTDIR/proto/ovsec_adm.dict $K5ROOT/ovsec_adm.dict
 
 eval $SRVTCL <<'EOF' $REDIRECT
 source $env(TCLUTIL)
index dc958d62c6c826235ecda7f29a2207282b5219ca..26fef9150e8df0266052254b06cb13c0e0830635 100644 (file)
 # TOP is used.
 
 DUMMY=${TESTDIR=$TOP/testing}
-DUMMY=${SAVE_FILES=$TESTDIR/scripts/save_files.sh}
+DUMMY=${STESTDIR=$STOP/testing}
+DUMMY=${SAVE_FILES=$STESTDIR/scripts/save_files.sh}
 DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl}
-DUMMY=${START_SERVERS_LOCAL=$TESTDIR/scripts/start_servers_local}
+DUMMY=${START_SERVERS_LOCAL=$STESTDIR/scripts/start_servers_local}
 # This'll be wrong sometimes
 DUMMY=${RSH_CMD=rsh}
 
@@ -43,7 +44,7 @@ if [ $local = 0 ]; then
        # Fix up the local krb5.conf to point to the remote 
        sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \
                -e "s/__KDCHOST__/$hostname/g" \
-               < $TESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
+               < $STESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
 
 # Using /usr/ucb/rsh and getting rid of "-k $REALM" until we get
 # around to fixing the fact that Kerberos rsh doesn't strip out "-k
index 249d3ffd0bd3bd91799b8e814df0180f26e98dfb..70c642fc4024e605185ad2c017e3f81975c9a4cb 100644 (file)
@@ -1,12 +1,13 @@
 #!/bin/sh
 
 DUMMY=${TESTDIR=$TOP/testing}
-DUMMY=${SAVE_FILES=$TESTDIR/scripts/save_files.sh}
+DUMMY=${STESTDIR=$STOP/testing}
+DUMMY=${SAVE_FILES=$STESTDIR/scripts/save_files.sh}
 DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl}
-DUMMY=${INITDB=$TESTDIR/scripts/init_db}
+DUMMY=${INITDB=$STESTDIR/scripts/init_db}
 DUMMY=${SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl}; export SRVTCL
 DUMMY=${LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl}
-DUMMY=${STOP_SERVERS_LOCAL=$TESTDIR/scripts/stop_servers_local}
+DUMMY=${STOP_SERVERS_LOCAL=$STESTDIR/scripts/stop_servers_local}
 
 if [ -d /usr/tmp ]; then
        usrtmp=/usr/tmp
index 563087e3186d297edd14a450ecd4c96df02f7979..e8dcac8383ac9ed789bd33ee16b82e630b6ad987 100644 (file)
@@ -10,8 +10,9 @@
 # TOP is used.
 
 DUMMY=${TESTDIR=$TOP/testing}
+DUMMY=${STESTDIR=$STOP/testing}
 DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl}
-DUMMY=${STOP_SERVERS_LOCAL=$TESTDIR/scripts/stop_servers_local}
+DUMMY=${STOP_SERVERS_LOCAL=$STESTDIR/scripts/stop_servers_local}
 # This'll be wrong sometimes
 DUMMY=${RSH_CMD=rsh}
 DUMMY=${RESTORE_FILES=$TESTDIR/scripts/restore_files.sh}