Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / tests / replay-ost-single.sh
index 3d68858..c2e493b 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
@@ -13,6 +13,8 @@ init_test_env $@
 ostfailover_HOST=${ostfailover_HOST:-$ost_HOST}
 #failover= must be defined in OST_MKFS_OPTIONS if ostfailover_HOST != ost_HOST
 
+remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
+
 # Tests that fail on uml
 CPU=`awk '/model/ {print $4}' /proc/cpuinfo`
 [ "$CPU" = "UML" ] && EXCEPT="$EXCEPT 6"
@@ -22,7 +24,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 +32,7 @@ OSTCOUNT=1
 build_test_filter
 
 REFORMAT=--reformat cleanup_and_setup_lustre
+assert_DIR
 rm -rf $DIR/[df][0-9]*
 
 test_0a() {
@@ -51,7 +54,7 @@ test_0b() {
 run_test 0b "empty replay"
 
 test_1() {
-    date > $DIR/$tfile
+    date > $DIR/$tfile || error "error creating $DIR/$tfile"
     fail ost1
     $CHECKSTAT -t file $DIR/$tfile || return 1
     rm -f $DIR/$tfile
@@ -60,11 +63,11 @@ run_test 1 "touch"
 
 test_2() {
     for i in `seq 10`; do
-        echo "tag-$i" > $DIR/$tfile-$i
+        echo "tag-$i" > $DIR/$tfile-$i || error "create $DIR/$tfile-$i"
     done 
     fail ost1
     for i in `seq 10`; do
-      grep -q "tag-$i" $DIR/$tfile-$i || error "f2-$i"
+      grep -q "tag-$i" $DIR/$tfile-$i || error "grep $DIR/$tfile-$i"
     done 
     rm -f $DIR/$tfile-*
 }
@@ -96,7 +99,7 @@ test_4() {
 run_test 4 "Fail OST during read, with verification"
 
 test_5() {
-    [ -z "`which iozone 2> /dev/null`" ] && log "iozone missing" && return
+    [ -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
@@ -117,10 +120,12 @@ test_5() {
 run_test 5 "Fail OST during iozone"
 
 kbytesfree() {
-   lctl get_param -n osc.*-osc-*.kbytesfree | awk '{total+=$1} END {print total}'
+   calc_osc_kbytes kbytesfree
 }
 
 test_6() {
+    remote_mds_nodsh && skip "remote MDS with nodsh" && return 0
+
     f=$DIR/$tfile
     rm -f $f
     sync && sleep 2 && sync    # wait for delete thread