Whamcloud - gitweb
simplify dbench test.
[fs/lustre-release.git] / lustre / tests / replay-ost-single.sh
index cd9e4df..1b1c5e8 100755 (executable)
@@ -3,7 +3,7 @@
 set -e
 
 PTLDEBUG=${PTLDEBUG:--1}
-LUSTRE=${LUSTRE:-`dirname $0`/..}
+LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
 SETUP=${SETUP:-""}
 CLEANUP=${CLEANUP:-""}
 . $LUSTRE/tests/test-framework.sh
@@ -22,7 +22,7 @@ CPU=`awk '/model/ {print $4}' /proc/cpuinfo`
 ALWAYS_EXCEPT="$REPLAY_OST_SINGLE_EXCEPT"
 
 #                                      
-[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="5"
 
 # It is replay-ost-single, after all
 OSTCOUNT=1
@@ -30,6 +30,7 @@ OSTCOUNT=1
 build_test_filter
 
 REFORMAT=--reformat cleanup_and_setup_lustre
+assert_DIR
 rm -rf $DIR/[df][0-9]*
 
 test_0a() {
@@ -96,11 +97,12 @@ test_4() {
 run_test 4 "Fail OST during read, with verification"
 
 test_5() {
-    [ -z "`which iozone 2> /dev/null`" ] && log "iozone missing" && return
-    FREE=`df -P -h $DIR | tail -n 1 | awk '{ print $3 }'`
-    case $FREE in
-    *T|*G) FREE=1G;;
-    esac
+    [ -z "`which iozone 2> /dev/null`" ] && skip "iozone missing" && return 0
+    FREE=`df -P $DIR | tail -n 1 | awk '{ print $4/2 }'`
+    GB=1048576  # 1048576KB == 1GB
+    if (( FREE > GB )); then
+        FREE=$GB
+    fi
     IOZONE_OPTS="-i 0 -i 1 -i 2 -+d -r 4 -s $FREE"
     iozone $IOZONE_OPTS -f $DIR/$tfile &
     PID=$!