Whamcloud - gitweb
LU-482 test: sync new fs before first replay test
[fs/lustre-release.git] / lustre / tests / replay-single.sh
index 596e7a4..da4b6f9 100755 (executable)
@@ -35,8 +35,12 @@ mkdir -p $DIR
 assert_DIR
 rm -rf $DIR/[df][0-9]*
 
+# LU-482 Avert LVM and VM inability to flush caches in pre .33 kernels
+if [ $LINUX_VERSION_CODE -lt $(kernel_version 2 6 33) ]; then
+    sync; sleep 5; sync; sleep 5; sync; sleep 5
+fi
+
 test_0a() {    # was test_0
-    sleep 10
     mkdir $DIR/$tfile
     replay_barrier $SINGLEMDS
     fail $SINGLEMDS
@@ -732,10 +736,11 @@ test_37() {
 
     replay_barrier $SINGLEMDS
     # clear the dmesg buffer so we only see errors from this recovery
-    dmesg -c >/dev/null
+    do_facet $SINGLEMDS dmesg -c >/dev/null
     fail_abort $SINGLEMDS
     kill -USR1 $pid
-    dmesg | grep  "mds_unlink_orphan.*error .* unlinking orphan" && return 1
+    do_facet $SINGLEMDS dmesg | grep "error .* unlinking .* from PENDING" &&
+       return 1
     wait $pid || return 3
     sync
     return 0
@@ -2077,7 +2082,10 @@ run_test 85a "check the cancellation of unused locks during recovery(IBITS)"
 test_85b() { #bug 16774
     lctl set_param -n ldlm.cancel_unused_locks_before_replay "1"
 
-    lfs setstripe -o 0 -c 1 $DIR
+    do_facet mgs $LCTL pool_new $FSNAME.$TESTNAME || return 1
+    do_facet mgs $LCTL pool_add $FSNAME.$TESTNAME $FSNAME-OST0000 || return 2
+
+    lfs setstripe -c 1 -p $FSNAME.$TESTNAME $DIR
 
     for i in `seq 100`; do
         dd if=/dev/urandom of=$DIR/$tfile-$i bs=4096 count=32 >/dev/null 2>&1
@@ -2093,12 +2101,16 @@ test_85b() { #bug 16774
     addr=`echo $lov_id | awk '{print $4}' | awk -F '-' '{print $3}'`
     count=`lctl get_param -n ldlm.namespaces.*OST0000*$addr.lock_unused_count`
     echo "before recovery: unused locks count = $count"
+    [ $count != 0 ] || return 3
 
     fail ost1
 
     count2=`lctl get_param -n ldlm.namespaces.*OST0000*$addr.lock_unused_count`
     echo "after recovery: unused locks count = $count2"
 
+    do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $FSNAME-OST0000 || return 4
+    do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME || return 5
+
     if [ $count2 -ge $count ]; then
         error "unused locks are not canceled"
     fi