Whamcloud - gitweb
LU-1227 tests: mds-survey.sh should check ost's space
[fs/lustre-release.git] / lustre / tests / sanity-gss.sh
index 171ea7c..b3062ed 100644 (file)
@@ -388,25 +388,32 @@ 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")
-    do_facet mds "echo 8 >> $ATHISTORY"
+    local ATHISTORY=$(do_facet $SINGLEMDS "find /sys/ -name at_history")
+    local ATOLDBASE=$(do_facet $SINGLEMDS "cat $ATHISTORY")
+    local REQ_DELAY
+    do_facet $SINGLEMDS "echo 8 >> $ATHISTORY"
+
+    mkdir -p $DIR/d8
+    chmod a+w $DIR/d8
 
     $LCTL dk > /dev/null
     debugsave
     sysctl -w lnet.debug="+other"
 
-    mkdir -p $DIR/d8
-    chmod a+w $DIR/d8
-
-    REQ_DELAY=`lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts |
-               awk '/portal 12/ {print $5}' | tail -1`
+    # wait for the at estimation come down, this is faster
+    while [ true ]; do
+        REQ_DELAY=`lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts |
+                   awk '/portal 12/ {print $5}' | tail -1`
+        [ $REQ_DELAY -le 5 ] && break
+        echo "current AT estimation is $REQ_DELAY, wait a little bit"
+        sleep 8
+    done
     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"
 
@@ -414,13 +421,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"
 
@@ -786,6 +793,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