From: Barry Jaspan Date: Fri, 20 Sep 1996 20:55:52 +0000 (+0000) Subject: create env-setup.sh X-Git-Tag: krb5-1.0-freeze1~324 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c31870dbc635420cbb7ad430413f67d037801d6a;p=krb5.git create env-setup.sh git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9098 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/testing/scripts/env-setup.sh b/src/kadmin/testing/scripts/env-setup.sh new file mode 100644 index 000000000..fd5b51ced --- /dev/null +++ b/src/kadmin/testing/scripts/env-setup.sh @@ -0,0 +1,81 @@ +#!/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 +# + +if [ "$TOP" = "" ]; then + echo "Error! \$TOP is not set." + exit 1 +fi + +TESTDIR=$TOP/testing; export TESTDIR +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; export QUALNAME + +START_SERVERS=$TESTDIR/scripts/start_servers $TEST_SERVER +export START_SERVERS +START_SERVERS_LOCAL=$TESTDIR/scripts/start_servers_local +export START_SERVERS_LOCAL + +STOP_SERVERS=$TESTDIR/scripts/stop_servers $TEST_SERVER +export STOP_SERVERS +STOP_SERVERS_LOCAL=$TESTDIR/scripts/stop_servers_local +export STOP_SERVERS_LOCAL + +KRB5_CONFIG=/krb5/krb5.conf; export KRB5_CONFIG +KRB5_KDC_PROFILE=/krb5/kdc.conf; export KRB5_KDC_PROFILE +KRB5_KTNAME=/krb5/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" + START_SERVERS="$START_SERVERS $TEST_PATH" + STOP_SERVERS="$STOP_SERVERS $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+"$@"} diff --git a/src/kadmin/testing/scripts/env-setup.shin b/src/kadmin/testing/scripts/env-setup.shin new file mode 100644 index 000000000..fd5b51ced --- /dev/null +++ b/src/kadmin/testing/scripts/env-setup.shin @@ -0,0 +1,81 @@ +#!/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 +# + +if [ "$TOP" = "" ]; then + echo "Error! \$TOP is not set." + exit 1 +fi + +TESTDIR=$TOP/testing; export TESTDIR +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; export QUALNAME + +START_SERVERS=$TESTDIR/scripts/start_servers $TEST_SERVER +export START_SERVERS +START_SERVERS_LOCAL=$TESTDIR/scripts/start_servers_local +export START_SERVERS_LOCAL + +STOP_SERVERS=$TESTDIR/scripts/stop_servers $TEST_SERVER +export STOP_SERVERS +STOP_SERVERS_LOCAL=$TESTDIR/scripts/stop_servers_local +export STOP_SERVERS_LOCAL + +KRB5_CONFIG=/krb5/krb5.conf; export KRB5_CONFIG +KRB5_KDC_PROFILE=/krb5/kdc.conf; export KRB5_KDC_PROFILE +KRB5_KTNAME=/krb5/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" + START_SERVERS="$START_SERVERS $TEST_PATH" + STOP_SERVERS="$STOP_SERVERS $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+"$@"}