Whamcloud - gitweb
LU-15146 mdt: mdt_lvb2reply crash fix
[fs/lustre-release.git] / lustre / tests / sanity-krb5.sh
index d38ad00..50f23ed 100755 (executable)
@@ -7,25 +7,20 @@
 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)
-SAVE_PWD=$PWD
-
-export MULTIOP=${MULTIOP:-multiop}
 
 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"
 
 [ "$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!"
@@ -65,8 +60,6 @@ rm -rf $DIR/[df][0-9]*
 
 check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS
 
-build_test_filter
-
 start_dbench()
 {
        local NPROC=$(grep -c ^processor /proc/cpuinfo)
@@ -118,6 +111,7 @@ stop_dbench()
 }
 
 restore_krb5_cred() {
+       keyctl reap
        cp $KRB5_CRED_SAVE $KRB5_CRED
        chown $RUNAS_ID:$RUNAS_ID $KRB5_CRED
        chmod 0600 $KRB5_CRED
@@ -129,7 +123,7 @@ check_multiple_gss_daemons() {
        local gssd_name=$(basename $gssd)
 
        for ((i = 0; i < 10; i++)); do
-               do_facet $facet "$gssd -v &"
+               do_facet $facet "$gssd -v"
        done
 
        # wait daemons entering "stable" status
@@ -310,25 +304,18 @@ test_5() {
 
        # flush context, and touch
        $RUNAS $LFS flushctx $MOUNT || error "can't flush context on $MOUNT"
-       $RUNAS touch $file2 &
-       TOUCHPID=$!
-
-       # wait certain time
-       echo "waiting $wait_time seconds for touch pid $TOUCHPID"
-       sleep $wait_time
-       num=$(ps --no-headers -p $TOUCHPID | wc -l)
-       [ $num -eq 1 ] || error "touch already ended ($num)"
-       echo "process $TOUCHPID still hanging there... OK"
+       $RUNAS touch $file2 && error 'should fail without lsvcgssd'
 
        # restart lsvcgssd, expect touch suceed
        echo "restart lsvcgssd and recovering"
        start_gss_daemons $(comma_list $(mdts_nodes)) "$LSVCGSSD -v"
        sleep 5
        check_gss_daemon_nodes $(comma_list $(mdts_nodes)) lsvcgssd
-       wait $TOUCHPID || error "touch fail"
+       $RUNAS keyctl reap
+       $RUNAS touch $file2 || error 'should not fail now'
        [ -f $file2 ] || error "$file2 not found"
 }
-run_test 5 "lsvcgssd dead, operations lead to recovery"
+run_test 5 "lsvcgssd dead, operations fail"
 
 test_6() {
        local nfile=10
@@ -415,7 +402,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