Whamcloud - gitweb
LU-1031: add grouplock test to sanity.sh
[fs/lustre-release.git] / lustre / tests / sanity-gss.sh
index 7bfa864..60104e5 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
+# vim:shiftwidth=4:softtabstop=4:tabstop=4:
 #
 # Run select tests by setting ONLY, or as arguments to the script.
 # Skip specific tests by setting EXCEPT.
@@ -26,6 +26,8 @@ export PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$SRCDIR/../utils/gss:$PATH:/sb
 export NAME=${NAME:-local}
 SAVE_PWD=$PWD
 
+export MULTIOP=${MULTIOP:-multiop}
+
 CLEANUP=${CLEANUP:-""}
 SETUP=${SETUP:-""}
 
@@ -241,7 +243,7 @@ test_3() {
     $RUNAS cat $file > /dev/null || error "$RUNAS_ID cat error"
 
     # start multiop
-    $RUNAS multiop $file o_r &
+    $RUNAS $MULTIOP $file o_r &
     OPPID=$!
     # wait multiop finish its open()
     sleep 1
@@ -388,10 +390,10 @@ run_test 7 "exercise enlarge_reqbuf()"
 
 test_8()
 {
-    local ATHISTORY=$(do_facet mds "find /sys/ -name at_history")
-    local ATOLDBASE=$(do_facet mds "cat $ATHISTORY")
+    local ATHISTORY=$(do_facet $SINGLEMDS "find /sys/ -name at_history")
+    local ATOLDBASE=$(do_facet $SINGLEMDS "cat $ATHISTORY")
     local REQ_DELAY
-    do_facet mds "echo 8 >> $ATHISTORY"
+    do_facet $SINGLEMDS "echo 8 >> $ATHISTORY"
 
     mkdir -p $DIR/d8
     chmod a+w $DIR/d8
@@ -411,9 +413,9 @@ test_8()
     REQ_DELAY=$((${REQ_DELAY} + ${REQ_DELAY} / 4 + 5))
 
     # sleep sometime in ctx handle
-    do_facet mds lctl set_param fail_val=$REQ_DELAY
+    do_facet $SINGLEMDS lctl set_param fail_val=$REQ_DELAY
 #define OBD_FAIL_SEC_CTX_HDL_PAUSE       0x1204
-    do_facet mds lctl set_param fail_loc=0x1204
+    do_facet $SINGLEMDS lctl set_param fail_loc=0x1204
 
     $RUNAS $LFS flushctx $MOUNT || error "can't flush context on $MOUNT"
 
@@ -421,13 +423,13 @@ test_8()
     TOUCHPID=$!
     echo "waiting for touch (pid $TOUCHPID) to finish..."
     sleep 2 # give it a chance to really trigger context init rpc
-    do_facet mds sysctl -w lustre.fail_loc=0
+    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"
 
     debugrestore
-    do_facet mds "echo $ATOLDBASE >> $ATHISTORY" || true
+    do_facet $SINGLEMDS "echo $ATOLDBASE >> $ATHISTORY" || true
 }
 run_test 8 "Early reply sent for slow gss context negotiation"
 
@@ -638,7 +640,7 @@ switch_sec_test()
     do_facet $SINGLEMDS lctl set_param fail_val=36
     do_facet $SINGLEMDS lctl set_param fail_loc=0x513
     log "starting multiop"
-    multiop $filename m &
+    $MULTIOP $filename m &
     multiop_pid=$!
     echo "multiop pid=$multiop_pid"
     sleep 1
@@ -793,6 +795,6 @@ test_151() {
 }
 run_test 151 "secure mgs connection: server flavor control"
 
-equals_msg `basename $0`: test complete, cleaning up
+complete $(basename $0) $SECONDS
 check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status