3 # The KADM5 unit tests were developed to work under gmake. As a
4 # result, they expect to inherit a number of environment variables.
5 # Rather than rewrite the tests, we simply use this script as an
6 # execution wrapper that sets all the necessary environment variables
7 # before running the program specified on its command line.
9 # The variable settings all came from OV's config.mk.
11 # Usage: env-setup.sh <command line>
18 # These two may be needed in case $libdir references them.
20 exec_prefix=@exec_prefix@
21 libdir=@libdir@ ; eval "libdir=$libdir"; export libdir
23 # The shared library run time setup
25 PROG_LIBPATH=-L@RBUILD@/lib
28 PROG_RPATH=@RBUILD@/lib
30 FAKEDEST=@RBUILD@/util/fakedest
31 # This converts $(TOPLIBD) to $TOPLIBD
32 cat > /tmp/env_setup$$ <<\EOF
36 foo=`sed -e 's/(//g' -e 's/)//g' -e 's/\\\$\\\$/\$/g' /tmp/env_setup$$`
39 # This will get put in setup.csh for convenience
40 KRB5_RUN_ENV_CSH=`eval echo "$foo" | \
41 sed -e 's/\([^=]*\)=\(.*\)/setenv \1 \2/g' \
42 -e 's/export [^ ;]*;//g'`
43 export KRB5_RUN_ENV_CSH
46 TESTDIR=$TOP/testing; export TESTDIR
47 STESTDIR=$STOP/testing; export STESTDIR
48 if [ "$K5ROOT" = "" ]; then
49 K5ROOT="`cd $TESTDIR; pwd`/krb5-test-root"
53 # If $VERBOSE_TEST is non-null, enter verbose mode. Set $VERBOSE to
54 # true or false so its exit status identifies the mode.
55 if test x$VERBOSE_TEST = x; then
62 REALM=SECURE-TEST.OV.COM; export REALM
64 if test x$EXPECT = x; then
65 EXPECT=@EXPECT@; export EXPECT
68 COMPARE_DUMP=$TESTDIR/scripts/compare_dump.pl; export COMPARE_DUMP
69 INITDB=$STESTDIR/scripts/init_db; export INITDB
70 MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl; export MAKE_KEYTAB
71 LOCAL_MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl
72 export LOCAL_MAKE_KEYTAB
73 SIMPLE_DUMP=$TESTDIR/scripts/simple_dump.pl; export SIMPLE_DUMP
74 QUALNAME=$TESTDIR/scripts/qualname.pl; export QUALNAME
75 TCLUTIL=$STESTDIR/tcl/util.t; export TCLUTIL
76 BSDDB_DUMP=$TESTDIR/util/bsddb_dump; export BSDDB_DUMP
77 CLNTTCL=$TESTDIR/util/ovsec_kadm_clnt_tcl; export CLNTTCL
78 SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl; export SRVTCL
80 KRB5_CONFIG=$K5ROOT/krb5.conf; export KRB5_CONFIG
81 KRB5_KDC_PROFILE=$K5ROOT/kdc.conf; export KRB5_KDC_PROFILE
82 KRB5_KTNAME=$K5ROOT/ovsec_adm.srvtab; export KRB5_KTNAME
83 KRB5CCNAME=$K5ROOT/krb5cc_unit-test; export KRB5CCNAME
85 if [ "$TEST_SERVER" != "" ]; then
86 MAKE_KEYTAB="$MAKE_KEYTAB -server $TEST_SERVER"
88 if [ "$TEST_PATH" != "" ]; then
89 MAKE_KEYTAB="$MAKE_KEYTAB -top $TEST_PATH"
92 if [ "x$PS_ALL" = "x" ]; then
93 ps -axwwu >/dev/null 2>&1
96 ps -ef >/dev/null 2>&1
99 if [ $ps_bsd = 0 -a $ps_sysv = 1 ]; then
102 elif [ $ps_bsd = 1 -a $ps_sysv = 0 ]; then
108 echo "WARNING! Cannot auto-detect ps type, assuming BSD."