Whamcloud - gitweb
LU-774 test: wait till space from previous tests is released
[fs/lustre-release.git] / lustre / tests / replay-ost-single.sh
index 1bdbcbf..d81acbf 100755 (executable)
@@ -8,18 +8,14 @@ CLEANUP=${CLEANUP:-""}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+init_logging
 
 # While we do not use OSTCOUNT=1 setup anymore,
 # ost1failover_HOST is used
 #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
-
-if [ "$FAILURE_MODE" = "HARD" ] && mixed_ost_devs; then
-    skip_env "$0: Several ost services on one ost node are used with FAILURE_MODE=$FAILURE_MODE. "
-    exit 0
-fi
+require_dsh_ost || exit 0
 
 # Tests that fail on uml
 CPU=`awk '/model/ {print $4}' /proc/cpuinfo`
@@ -181,6 +177,12 @@ test_6() {
     f=$TDIR/$tfile
     rm -f $f
     sync && sleep 2 && sync    # wait for delete thread
+
+    # wait till space is returned, following
+    # (( $before > $after_dd)) test counting on that
+    wait_mds_ost_sync || return 4
+    wait_destroy_complete || return 5
+
     before=`kbytesfree`
     dd if=/dev/urandom bs=4096 count=1280 of=$f || return 28
     lfs getstripe $f
@@ -190,7 +192,7 @@ test_6() {
     sleep 2 # ensure we have a fresh statfs
     sync
 #define OBD_FAIL_MDS_REINT_NET_REP       0x119
-    do_facet mds "lctl set_param fail_loc=0x80000119"
+    do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119"
     after_dd=`kbytesfree`
     log "before: $before after_dd: $after_dd"
     (( $before > $after_dd )) || return 1
@@ -212,6 +214,12 @@ test_7() {
     f=$TDIR/$tfile
     rm -f $f
     sync && sleep 5 && sync    # wait for delete thread
+
+    # wait till space is returned, following
+    # (( $before > $after_dd)) test counting on that
+    wait_mds_ost_sync || return 4
+    wait_destroy_complete || return 5
+
     before=`kbytesfree`
     dd if=/dev/urandom bs=4096 count=1280 of=$f || return 4
     sync
@@ -235,6 +243,6 @@ test_7() {
 }
 run_test 7 "Fail OST before obd_destroy"
 
-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