X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-gss.sh;h=9b0d3ff80334a0a5fbb6fe5eca73fecdf76a9c76;hb=56f69854dae234fa974ab4f1dff909aea601a592;hp=541eeac1f1753e34d4f249e3d7c8542d6ec88de4;hpb=8cffc4a0255d007d358e7e1ed843bacb4d9c7f7c;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-gss.sh b/lustre/tests/sanity-gss.sh index 541eeac..9b0d3ff 100755 --- a/lustre/tests/sanity-gss.sh +++ b/lustre/tests/sanity-gss.sh @@ -7,26 +7,27 @@ set -e ONLY=${ONLY:-"$*"} -# bug number for skipped test: -ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"$SANITY_GSS_EXCEPT"} -# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! -SRCDIR=`dirname $0` - -export MULTIOP=${MULTIOP:-multiop} - -LUSTRE=${LUSTRE:-`dirname $0`/..} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging -require_dsh_mds || exit 0 +ALWAYS_EXCEPT="$SANITY_GSS_EXCEPT " +if $SHARED_KEY; then +# bug number for skipped tests: LU-9795 LU-9795 + ALWAYS_EXCEPT+=" 8 90 " +fi [ "$SLOW" = "no" ] && EXCEPT_SLOW="100 101" +build_test_filter + +require_dsh_mds || exit 0 + # $RUNAS_ID may get set incorrectly somewhere else -[ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!" +[ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && + error "\$RUNAS_ID set to 0, but \$UID is also 0!" # remove $SEC, we'd like to control everything by ourselves unset SEC @@ -47,24 +48,22 @@ rm -rf $DIR/[df][0-9]* check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS -build_test_filter - start_dbench() { - NPROC=`cat /proc/cpuinfo 2>/dev/null | grep ^processor | wc -l` - [ $NPROC -gt 2 ] && NPROC=2 - sh rundbench $NPROC 1>/dev/null & - DBENCH_PID=$! - sleep 2 - - num=`ps --no-headers -p $DBENCH_PID 2>/dev/null | wc -l` - if [ $num -ne 1 ]; then - error "failed to start dbench $NPROC" - else - echo "started dbench with $NPROC processes at background" - fi - - return 0 + NPROC=`cat /proc/cpuinfo 2>/dev/null | grep ^processor | wc -l` + [ $NPROC -gt 2 ] && NPROC=2 + bash rundbench $NPROC 1>/dev/null & + DBENCH_PID=$! + sleep 2 + + num=`ps --no-headers -p $DBENCH_PID 2>/dev/null | wc -l` + if [ $num -ne 1 ]; then + error "failed to start dbench $NPROC" + else + echo "started dbench with $NPROC processes at background" + fi + + return 0 } check_dbench() @@ -102,6 +101,25 @@ stop_dbench() calc_connection_cnt umask 077 +# Stop previously existing gss daemons +stop_gss_daemons + +echo "bring up gss daemons..." +# start gss daemon with -z flag for gssnull +start_gss_daemons $(comma_list $(mdts_nodes)) "$LSVCGSSD -z -vv" || + error "can't start gss daemons on MDTs" +start_gss_daemons $(comma_list $(osts_nodes)) "$LSVCGSSD -z -vv" || + error "can't start gss daemons on OSTs" + +lctl set_param sptlrpc.gss.lgss_keyring.debug_level=4 + +echo "cat /etc/request-key.d/lgssc.conf" +cat /etc/request-key.d/lgssc.conf || + error_noexit "/etc/request-key.d/lgssc.conf does not exist" +echo "cat /etc/request-key.conf" +cat /etc/request-key.conf || + error_noexit "/etc/request-key.conf does not exist" + set_flavor_all gssnull test_1() { @@ -242,7 +260,7 @@ test_8() do_facet $SINGLEMDS $LCTL set_param fail_loc=0 wait $TOUCHPID || error "touch should have succeeded" - $LCTL dk | grep "Early reply #" || error "No early reply" + $LCTL dk | grep -i "Early reply #" || error "No early reply" debugrestore do_facet $SINGLEMDS "echo $ATOLDBASE >> $ATHISTORY" || true @@ -507,7 +525,7 @@ test_102() { run_test 102 "survive from insanely fast flavor switch" test_150() { - local save_opts + local mount_opts local count local clients=$CLIENTS @@ -524,18 +542,14 @@ test_150() { zconf_umount_clients $clients $MOUNT || return 1 # mount client with conflict flavor - should fail - save_opts=$MOUNTOPT - MOUNTOPT="$MOUNTOPT,mgssec=gssnull" - zconf_mount_clients $clients $MOUNT && - error "mount with conflict flavor should have failed" - MOUNTOPT=$save_opts + mount_opts="${MOUNT_OPTS:+$MOUNT_OPTS,}mgssec=gssnull" + zconf_mount_clients $clients $MOUNT $mount_opts && + error "mount with conflict flavor should have failed" # mount client with same flavor - should succeed - save_opts=$MOUNTOPT - MOUNTOPT="$MOUNTOPT,mgssec=null" - zconf_mount_clients $clients $MOUNT || \ + mount_opts="${MOUNT_OPTS:+$MOUNT_OPTS,}mgssec=null" + zconf_mount_clients $clients $MOUNT $mount_opts || error "mount with same flavor should have succeeded" - MOUNTOPT=$save_opts zconf_umount_clients $clients $MOUNT || return 2 # mount client with default flavor - should succeed @@ -575,6 +589,13 @@ test_151() { } run_test 151 "secure mgs connection: server flavor control" +stop_gss_daemons +if $GSS_KRB5 || $GSS_SK; then + start_gss_daemons +fi + +restore_to_default_flavor + complete $SECONDS check_and_cleanup_lustre exit_status