Whamcloud - gitweb
b=13709
[fs/lustre-release.git] / lustre / tests / replay-ost-single.sh
index 9fe3f77..44a9824 100755 (executable)
@@ -4,6 +4,8 @@ set -e
 
 PTLDEBUG=${PTLDEBUG:--1}
 LUSTRE=${LUSTRE:-`dirname $0`/..}
+SETUP=${SETUP:-""}
+CLEANUP=${CLEANUP:-""}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
@@ -26,19 +28,11 @@ gen_config() {
     formatall
 }
 
-cleanup() {
-    cleanupall
-}
-
-if [ "$ONLY" == "cleanup" ]; then
-    cleanup
-    exit
-fi
-
 build_test_filter
 
-SETUP=${SETUP:-"setup"}
-CLEANUP=${CLEANUP:-"cleanup"}
+cleanup_and_setup_lustre
+rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
+rm -rf $DIR/[df][0-9]*
 
 test_0a() {
     # needs to run during initial client->OST connection
@@ -114,9 +108,7 @@ test_4() {
     verify=$ROOT/tmp/verify-$$
     dd if=/dev/urandom bs=4096 count=1280 | tee $verify > $DIR/$tfile
     # invalidate cache, so that we're reading over the wire
-    for i in /proc/fs/lustre/ldlm/namespaces/*-osc-*; do
-        echo -n clear > $i/lru_size
-    done
+    cancel_lru_locks osc
     cmp $verify $DIR/$tfile &
     cmppid=$!
     fail ost1
@@ -202,5 +194,5 @@ test_7() {
 run_test 7 "Fail OST before obd_destroy"
 
 equals_msg `basename $0`: test complete, cleaning up
-$CLEANUP
+check_and_cleanup_lustre
 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true