From 87d92f4af2b977a811037033c8c7e9f89a5fc32a Mon Sep 17 00:00:00 2001 From: ericm Date: Fri, 13 May 2005 16:41:12 +0000 Subject: [PATCH] adjust krb5 related scripts, add krb5 support in replay-ost-single, sanityN, sanity-ldlm. --- lustre/tests/llmount.sh | 14 +++++--------- lustre/tests/llrmount.sh | 14 +++++--------- lustre/tests/recovery-small.sh | 8 ++++---- lustre/tests/replay-dual.sh | 8 ++++---- lustre/tests/replay-ost-single.sh | 5 +++++ lustre/tests/replay-single.sh | 8 ++++---- lustre/tests/sanity-fid.sh | 15 --------------- lustre/tests/sanity-gns.sh | 15 --------------- lustre/tests/sanity-ldlm.sh | 1 + lustre/tests/sanity-lmv.sh | 15 --------------- lustre/tests/sanityN.sh | 9 +++++++++ 11 files changed, 37 insertions(+), 75 deletions(-) diff --git a/lustre/tests/llmount.sh b/lustre/tests/llmount.sh index a8901ba..253932f 100755 --- a/lustre/tests/llmount.sh +++ b/lustre/tests/llmount.sh @@ -13,6 +13,8 @@ mkconfig=$(dirname $0)/$NAME.sh . krb5_env.sh start_krb5_kdc || exit 1 +start_lsvcgssd || exit 2 +start_lgssd || exit 3 if [ "$PORTALS" ]; then portals_opt="--portals=$PORTALS" @@ -25,23 +27,17 @@ fi if [ "$LDAPURL" ]; then conf_opt="--ldapurl $LDAPURL --config $NAME" else - sh $mkconfig $config || exit 2 + sh $mkconfig $config || exit 4 conf_opt="$config" fi [ "$NODE" ] && node_opt="--node $NODE" [ "$DEBUG" ] && debug_opt="--ptldebug=$DEBUG" -# We'd better start lsvcgssd after gss modules loaded. -# remove this if we don't depend on lsvcgssd in the future -${LCONF} --nosetup --sec $SECURITY $portals_opt $node_opt $@ $conf_opt || exit 3 -start_lsvcgssd || exit 4 -start_lgssd || exit 5 - ${LCONF} $NOMOD --sec $SECURITY $portals_opt $lustre_opt $node_opt \ - ${REFORMAT:---reformat} $@ $conf_opt || exit 6 + ${REFORMAT:---reformat} $@ $conf_opt || exit 5 if [ "$MOUNT2" ]; then - $LLMOUNT -v -o sec=$SECURITY `hostname`:/mds1/client $MOUNT2 || exit 7 + $LLMOUNT -v -o sec=$SECURITY `hostname`:/mds1/client $MOUNT2 || exit 6 fi diff --git a/lustre/tests/llrmount.sh b/lustre/tests/llrmount.sh index 3de7fcf1..0cc2853 100755 --- a/lustre/tests/llrmount.sh +++ b/lustre/tests/llrmount.sh @@ -13,6 +13,8 @@ mkconfig=$NAME.sh . krb5_env.sh start_krb5_kdc || exit 1 +start_lsvcgssd || exit 2 +start_lgssd || exit 3 if [ "$PORTALS" ]; then portals_opt="--portals=$PORTALS" @@ -26,23 +28,17 @@ if [ "$LDAPURL" ]; then conf_opt="--ldapurl $LDAPURL --config $NAME" else if [ ! -f $config -o $mkconfig -nt $config ]; then - sh $mkconfig $config || exit 2 + sh $mkconfig $config || exit 4 fi conf_opt="$config" fi [ "$NODE" ] && node_opt="--node $NODE" -# We'd better start lsvcgssd after gss modules loaded. -# remove this if we don't depend on lsvcgssd in the future -${LCONF} --nosetup --sec $SECURITY $portals_opt $node_opt $@ $conf_opt || exit 3 -start_lsvcgssd || exit 4 -start_lgssd || exit 5 - ${LCONF} $NOMOD --sec $SECURITY $portals_opt $lustre_opt $node_opt \ - $@ $conf_opt || exit 6 + $@ $conf_opt || exit 5 if [ "$MOUNT2" ]; then - $LLMOUNT -v -o sec=$SECURITY `hostname`:/mds1/client $MOUNT2 || exit 7 + $LLMOUNT -v -o sec=$SECURITY `hostname`:/mds1/client $MOUNT2 || exit 6 fi diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 2f84c01..ac1a811 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -51,10 +51,10 @@ gen_config() { setup() { gen_config start_krb5_kdc || exit 1 - start ost --reformat $OSTLCONFARGS - start ost2 --reformat $OSTLCONFARGS start_lsvcgssd || exit 2 start_lgssd || exit 3 + start ost --reformat $OSTLCONFARGS + start ost2 --reformat $OSTLCONFARGS [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE for mds in `mds_list`; do start $mds --reformat $MDSLCONFARGS @@ -67,10 +67,10 @@ cleanup() { for mds in `mds_list`; do stop $mds ${FORCE} $MDSLCONFARGS done - stop_lgssd - stop_lsvcgssd stop ost2 ${FORCE} --dump cleanup.log stop ost ${FORCE} --dump cleanup.log + stop_lgssd + stop_lsvcgssd } if [ ! -z "$EVAL" ]; then diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index bd5a748..a09ef1b 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -63,10 +63,10 @@ cleanup() { sleep 5 stop $mds ${FORCE} $MDSLCONFARGS done - stop_lgssd - stop_lsvcgssd stop ost2 ${FORCE} stop ost ${FORCE} --dump cleanup-dual.log + stop_lgssd + stop_lsvcgssd } if [ "$ONLY" == "cleanup" ]; then @@ -79,6 +79,8 @@ setup() { gen_config start_krb5_kdc || exit 1 + start_lsvcgssd || exit 2 + start_lgssd || exit 3 start ost --reformat $OSTLCONFARGS PINGER=`cat /proc/fs/lustre/pinger` @@ -89,8 +91,6 @@ setup() { fi start ost2 --reformat $OSTLCONFARGS - start_lsvcgssd || exit 2 - start_lgssd || exit 3 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE for mds in `mds_list`; do start $mds --reformat $MDSLCONFARGS diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 398386d..095ef8b 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -53,6 +53,8 @@ cleanup() { stop $mds ${FORCE} $MDSLCONFARGS done stop ost ${FORCE} --dump cleanup.log + stop_lgssd + stop_lsvcgssd } if [ "$ONLY" == "cleanup" ]; then @@ -69,6 +71,9 @@ CLEANUP=${CLEANUP:-"cleanup"} setup() { gen_config + start_krb5_kdc || exit 1 + start_lsvcgssd || exit 2 + start_lgssd || exit 3 start ost --reformat $OSTLCONFARGS [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE for mds in `mds_list`; do diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index b2c2616..41aabf3 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -66,10 +66,10 @@ cleanup() { for mds in `mds_list`; do stop $mds ${FORCE} $MDSLCONFARGS done - stop_lgssd - stop_lsvcgssd stop ost2 ${FORCE} --dump cleanup.log stop ost ${FORCE} --dump cleanup.log + stop_lgssd + stop_lsvcgssd } if [ "$ONLY" == "cleanup" ]; then @@ -85,10 +85,10 @@ setup() { gen_config start_krb5_kdc || exit 1 - start ost --reformat $OSTLCONFARGS - start ost2 --reformat $OSTLCONFARGS start_lsvcgssd || exit 2 start_lgssd || exit 3 + start ost --reformat $OSTLCONFARGS + start ost2 --reformat $OSTLCONFARGS [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE for mds in `mds_list`; do start $mds --reformat $MDSLCONFARGS diff --git a/lustre/tests/sanity-fid.sh b/lustre/tests/sanity-fid.sh index 72942c7..2da851a 100644 --- a/lustre/tests/sanity-fid.sh +++ b/lustre/tests/sanity-fid.sh @@ -37,21 +37,6 @@ MODE=${MODE:mds} . krb5_env.sh -if [ $UID -ne 0 ]; then - RUNAS_ID="$UID" - RUNAS="" -else - RUNAS_ID=${RUNAS_ID:-500} - RUNAS=${RUNAS:-"runas -u $RUNAS_ID"} -fi - -if [ `using_krb5_sec $SECURITY` == 'y' ] ; then - start_krb5_kdc || exit 1 - if [ $RUNAS_ID -ne $UID ]; then - $RUNAS ./krb5_refresh_cache.sh || exit 2 - fi -fi - export NAME=${NAME:-local} SAVE_PWD=$PWD diff --git a/lustre/tests/sanity-gns.sh b/lustre/tests/sanity-gns.sh index b55312a..0e07952 100644 --- a/lustre/tests/sanity-gns.sh +++ b/lustre/tests/sanity-gns.sh @@ -38,21 +38,6 @@ PTLDEBUG=${PTLDEBUG:-0} . krb5_env.sh -if [ $UID -ne 0 ]; then - RUNAS_ID="$UID" - RUNAS="" -else - RUNAS_ID=${RUNAS_ID:-500} - RUNAS=${RUNAS:-"runas -u $RUNAS_ID"} -fi - -if [ `using_krb5_sec $SECURITY` == 'y' ] ; then - start_krb5_kdc || exit 1 - if [ $RUNAS_ID -ne $UID ]; then - $RUNAS ./krb5_refresh_cache.sh || exit 2 - fi -fi - export NAME=${NAME:-local} SAVE_PWD=$PWD diff --git a/lustre/tests/sanity-ldlm.sh b/lustre/tests/sanity-ldlm.sh index e5bd422..68dbb0f 100644 --- a/lustre/tests/sanity-ldlm.sh +++ b/lustre/tests/sanity-ldlm.sh @@ -8,6 +8,7 @@ PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH MOUNT=${MOUNT:-/mnt/lustre} DIR=${DIR:-$MOUNT} export NAME=$NAME +. krb5_env.sh clean() { echo -n "cln.." sh llmountcleanup.sh > /dev/null || exit 20 diff --git a/lustre/tests/sanity-lmv.sh b/lustre/tests/sanity-lmv.sh index e31e045..0a11ed7 100644 --- a/lustre/tests/sanity-lmv.sh +++ b/lustre/tests/sanity-lmv.sh @@ -44,21 +44,6 @@ PTLDEBUG=${PTLDEBUG:-0} . krb5_env.sh -if [ $UID -ne 0 ]; then - RUNAS_ID="$UID" - RUNAS="" -else - RUNAS_ID=${RUNAS_ID:-500} - RUNAS=${RUNAS:-"runas -u $RUNAS_ID"} -fi - -if [ `using_krb5_sec $SECURITY` == 'y' ] ; then - start_krb5_kdc || exit 1 - if [ $RUNAS_ID -ne $UID ]; then - $RUNAS ./krb5_refresh_cache.sh || exit 2 - fi -fi - export NAME=${NAME:-lmv} SAVE_PWD=$PWD diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index 96532b7..576712b 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -24,6 +24,8 @@ TOEXCL=${TOEXCL:-toexcl} TRUNCATE=${TRUNCATE:-truncate} export TMP=${TMP:-/tmp} +. krb5_env.sh + if [ $UID -ne 0 ]; then RUNAS_ID="$UID" RUNAS="" @@ -32,6 +34,13 @@ else RUNAS=${RUNAS:-"runas -u $RUNAS_ID"} fi +if [ `using_krb5_sec $SECURITY` == 'y' ] ; then + start_krb5_kdc || exit 1 + if [ $RUNAS_ID -ne $UID ]; then + $RUNAS ./krb5_refresh_cache.sh || exit 2 + fi +fi + SAVE_PWD=$PWD clean() { -- 1.8.3.1