From 46b7f26b2af2f24e90f7577cf84772930dbfd07c Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Fri, 27 Sep 1996 21:09:00 +0000 Subject: [PATCH] * start_servers, start_servers_local, stop_servers, init_db, env-setup.sh: first pass at making TEST_SERVER remote server testing work git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9132 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/testing/scripts/ChangeLog | 4 +++ src/kadmin/testing/scripts/env-setup.sh | 18 ++++------- src/kadmin/testing/scripts/env-setup.shin | 18 ++++------- src/kadmin/testing/scripts/init_db | 1 + src/kadmin/testing/scripts/start_servers | 17 ++++++----- .../testing/scripts/start_servers_local | 2 +- src/kadmin/testing/scripts/stop_servers | 30 ++++--------------- 7 files changed, 34 insertions(+), 56 deletions(-) diff --git a/src/kadmin/testing/scripts/ChangeLog b/src/kadmin/testing/scripts/ChangeLog index 7896242a1..96ff8972c 100644 --- a/src/kadmin/testing/scripts/ChangeLog +++ b/src/kadmin/testing/scripts/ChangeLog @@ -1,5 +1,9 @@ Fri Sep 27 14:12:59 1996 Barry Jaspan + * start_servers, start_servers_local, stop_servers, init_db, + env-setup.sh: first pass at making TEST_SERVER remote server + testing work + * env-setup.sh: set K5ROOT to $TESTDIR/krb5-test-root by default, but use an absolute path diff --git a/src/kadmin/testing/scripts/env-setup.sh b/src/kadmin/testing/scripts/env-setup.sh index 0713cddd4..4ae11471e 100644 --- a/src/kadmin/testing/scripts/env-setup.sh +++ b/src/kadmin/testing/scripts/env-setup.sh @@ -21,6 +21,12 @@ 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 @@ -37,16 +43,6 @@ 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 -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=$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 @@ -56,8 +52,6 @@ if [ "$TEST_SERVER" != "" ]; then 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 diff --git a/src/kadmin/testing/scripts/env-setup.shin b/src/kadmin/testing/scripts/env-setup.shin index 0713cddd4..4ae11471e 100644 --- a/src/kadmin/testing/scripts/env-setup.shin +++ b/src/kadmin/testing/scripts/env-setup.shin @@ -21,6 +21,12 @@ 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 @@ -37,16 +43,6 @@ 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 -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=$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 @@ -56,8 +52,6 @@ if [ "$TEST_SERVER" != "" ]; then 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 diff --git a/src/kadmin/testing/scripts/init_db b/src/kadmin/testing/scripts/init_db index 4b710b319..4b4d95485 100644 --- a/src/kadmin/testing/scripts/init_db +++ b/src/kadmin/testing/scripts/init_db @@ -51,6 +51,7 @@ fi # done sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \ + -e "s/__KDCHOST__/localhost/g" \ < $TESTDIR/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 diff --git a/src/kadmin/testing/scripts/start_servers b/src/kadmin/testing/scripts/start_servers index 2e395faf8..dc958d62c 100644 --- a/src/kadmin/testing/scripts/start_servers +++ b/src/kadmin/testing/scripts/start_servers @@ -14,7 +14,7 @@ DUMMY=${SAVE_FILES=$TESTDIR/scripts/save_files.sh} DUMMY=${FIX_CONF_FILES=$TESTDIR/scripts/fixup-conf-files.pl} DUMMY=${START_SERVERS_LOCAL=$TESTDIR/scripts/start_servers_local} # This'll be wrong sometimes -DUMMY=${RSH_CMD=/usr/ucb/rsh} +DUMMY=${RSH_CMD=rsh} # If it's set, set it to true VERBOSE=${VERBOSE_TEST:+true} @@ -39,18 +39,21 @@ if [ $# -gt 0 ]; then fi if [ $local = 0 ]; then - $SAVE_FILES || exit 1 - $FIX_CONF_FILES -server $hostname || exit 1 + + # 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 # 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 # REALM" when falling back. START_SERVERS_LOCAL=`echo $START_SERVERS_LOCAL|sed "s%$TOP%$rempath%"` - CMD="$RSH_CMD $hostname -l root -n \ - \"cd $rempath; \\\`testing/scripts/find-make.sh\\\` execute VERBOSE_TEST=$VERBOSE_TEST \ - TOP=$rempath \ - CMD='$START_SERVERS_LOCAL $rempath'\"" + CMD="$RSH_CMD $hostname -n \ + \"sh -c 'VERBOSE_TEST=$VERBOSE_TEST TOP=$rempath \ + $rempath/testing/scripts/env-setup.sh \ + $START_SERVERS_LOCAL $rempath'\"" if $VERBOSE; then echo "+++" diff --git a/src/kadmin/testing/scripts/start_servers_local b/src/kadmin/testing/scripts/start_servers_local index cf4c79c07..249d3ffd0 100644 --- a/src/kadmin/testing/scripts/start_servers_local +++ b/src/kadmin/testing/scripts/start_servers_local @@ -154,7 +154,7 @@ while true; do else LOG_USER='log_user 0' fi - if expect <