Whamcloud - gitweb
LU-793 ptlrpc: fix ptlrpc_request_change_export()
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index 63d0b73..0cdc7f7 100755 (executable)
@@ -20,8 +20,8 @@ require_dsh_mds || exit 0
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="17  26a  26b    50   51     57"
 
 [ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
-# bug number for skipped test:       LU-2194
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 19b"
+# bug number for skipped test:       LU-2194 LU-2547
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 19b     24a 24b"
 
 build_test_filter
 
@@ -767,7 +767,8 @@ test_24a() { # bug 11710 details correct fsync() behavior
        rc=$?
        lctl set_param fail_loc=0x0
        client_reconnect
-       [ $rc -eq 0 ] && error_ignore 5494 "multiop didn't fail fsync: rc $rc" || true
+       [ $rc -eq 0 ] &&
+               error_ignore bz5494 "multiop didn't fail fsync: rc $rc" || true
 }
 run_test 24a "fsync error (should return error)"
 
@@ -807,10 +808,10 @@ test_24b() {
        lctl set_param fail_loc=0x0
        client_reconnect
        [ $rc1 -eq 0 -o $rc2 -eq 0 ] &&
-       error_ignore 5494 "multiop didn't fail fsync: $rc1 or close: $rc2" ||
+       error_ignore bz5494 "multiop didn't fail fsync: $rc1 or close: $rc2" ||
                true
 
-       dmesg | grep "dirty page discard:" || \
+       dmesg | grep "dirty page discard:" ||
                error "no discarded dirty page found!"
 }
 run_test 24b "test dirty page discard due to client eviction"
@@ -959,7 +960,8 @@ test_50() {
        rc=$?
        echo writemany returned $rc
        #these may fail because of eviction due to slow AST response.
-       [ $rc -eq 0 ] || error_ignore 13652 "writemany returned rc $rc" || true
+       [ $rc -eq 0 ] ||
+               error_ignore bz13652 "writemany returned rc $rc" || true
 }
 run_test 50 "failover MDS under load"
 
@@ -988,10 +990,11 @@ test_51() {
        # and recovery was interrupted
        sleep $TIMEOUT
         kill -USR1 $CLIENT_PID
-       wait $CLIENT_PID 
+       wait $CLIENT_PID
        rc=$?
        echo writemany returned $rc
-       [ $rc -eq 0 ] || error_ignore 13652 "writemany returned rc $rc" || true
+       [ $rc -eq 0 ] ||
+               error_ignore bz13652 "writemany returned rc $rc" || true
 }
 run_test 51 "failover MDS during recovery"
 
@@ -1060,57 +1063,58 @@ test_55() {
 
        mkdir -p $DIR/$tdir
 
+       # Minimum pass speed is 2MBps
+       local ddtimeout=64
+       # LU-2887/LU-3089 - set min pass speed to 500KBps
+       [ "$(facet_fstype ost1)" = "zfs" ] && ddtimeout=256
+
        # first dd should be finished quickly
        $LFS setstripe -c 1 -i 0 $DIR/$tdir/$tfile-1
-       dd if=/dev/zero of=$DIR/$tdir/$tfile-1 bs=32M count=4  &
+       dd if=/dev/zero of=$DIR/$tdir/$tfile-1 bs=32M count=4 &
        DDPID=$!
        count=0
        echo  "step1: testing ......"
-       while [ true ]; do
-           if [ -z `ps x | awk '$1 == '$DDPID' { print $5 }'` ]; then break; fi
-           count=$[count+1]
-           if [ $count -gt 64 ]; then
-               error "dd should be finished!"
-           fi
-           sleep 1
-       done    
+       while kill -0 $DDPID 2> /dev/null; do
+               let count++
+               if [ $count -gt $ddtimeout ]; then
+                       error "dd should be finished!"
+               fi
+               sleep 1
+       done
        echo "(dd_pid=$DDPID, time=$count)successful"
 
        $LFS setstripe -c 1 -i 0 $DIR/$tdir/$tfile-2
        #define OBD_FAIL_OST_DROP_REQ            0x21d
        do_facet ost1 lctl set_param fail_loc=0x0000021d
        # second dd will be never finished
-       dd if=/dev/zero of=$DIR/$tdir/$tfile-2 bs=32M count=4  &        
+       dd if=/dev/zero of=$DIR/$tdir/$tfile-2 bs=32M count=4 &
        DDPID=$!
        count=0
        echo  "step2: testing ......"
-       while [ $count -le 64 ]; do
-           dd_name="`ps x | awk '$1 == '$DDPID' { print $5 }'`"            
-           if [ -z  $dd_name ]; then 
-                ls -l $DIR/$tdir
-               echo  "debug: (dd_name=$dd_name, dd_pid=$DDPID, time=$count)"
-               error "dd shouldn't be finished!"
-           fi
-           count=$[count+1]
-           sleep 1
-       done    
+       while [ $count -le $ddtimeout ]; do
+               if ! kill -0 $DDPID 2> /dev/null; then
+                       ls -l $DIR/$tdir
+                       error "dd shouldn't be finished! (time=$count)"
+               fi
+               let count++
+               sleep 1
+       done
        echo "(dd_pid=$DDPID, time=$count)successful"
 
        #Recover fail_loc and dd will finish soon
        do_facet ost1 lctl set_param fail_loc=0
        count=0
        echo  "step3: testing ......"
-       while [ true ]; do
-           if [ -z `ps x | awk '$1 == '$DDPID' { print $5 }'` ]; then break; fi
-           count=$[count+1]
-           if [ $count -gt 500 ]; then
-               error "dd should be finished!"
-           fi
-           sleep 1
-       done    
+       while kill -0 $DDPID 2> /dev/null; do
+               let count++
+               if [ $count -gt $((ddtimeout + 440)) ]; then
+                       error "dd should be finished!"
+               fi
+               sleep 1
+       done
        echo "(dd_pid=$DDPID, time=$count)successful"
 
-        rm -rf $DIR/$tdir
+       rm -rf $DIR/$tdir
 }
 run_test 55 "ost_brw_read/write drops timed-out read/write request"
 
@@ -1184,12 +1188,12 @@ test_59() { # bug 10589
 run_test 59 "Read cancel race on client eviction"
 
 err17935 () {
-    # we assume that all md changes are in the MDT0 changelog
-    if [ $MDSCOUNT -gt 1 ]; then
-       error_ignore 17935 $*
-    else
-       error $*
-    fi
+       # we assume that all md changes are in the MDT0 changelog
+       if [ $MDSCOUNT -gt 1 ]; then
+               error_ignore bz17935 $*
+       else
+               error $*
+       fi
 }
 
 test_60() {
@@ -1504,10 +1508,11 @@ test_103()
         stop mds1
 
         # We need this test because mds is like a client in IR context.
-        start mds1 $MDSDEV1 || error "MDS should start w/o mgs"
+        start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS ||
+               error "MDS should start w/o mgs"
 
         # start mgs and remount mds w/ ir
-        start mgs $MGSDEV
+        start mgs $(mgsdevname) $MGS_MOUNT_OPTS
         clients_up
 
         # remount client so that fsdb will be created on the MGS
@@ -1768,7 +1773,11 @@ test_110f () {
 run_test 110f "remove remote directory: drop slave rep"
 
 # LU-2844 mdt prepare fail should not cause umount oops
-test_111 () {
+test_111 ()
+{
+       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.62) ]] ||
+               { skip "Need MDS version at least 2.3.62"; return 0; }
+
        local mdsdev=$(mdsdevname ${SINGLEMDS//mds/})
 #define OBD_FAIL_MDS_CHANGELOG_INIT 0x151
        do_facet $SINGLEMDS lctl set_param fail_loc=0x151
@@ -1779,6 +1788,26 @@ test_111 () {
 }
 run_test 111 "mdd setup fail should not cause umount oops"
 
+# LU-793
+test_112a() {
+       remote_ost_nodsh && skip "remote OST with nodsh" && return 0
+
+       do_facet_random_file client $TMP/$tfile 100K ||
+               error_noexit "Create random file $TMP/$tfile"
+
+       pause_bulk "cp $TMP/$tfile $DIR/$tfile" $TIMEOUT ||
+               error_noexit "Can't pause_bulk copy"
+
+       df $DIR
+       # expect cmp to succeed, client resent bulk
+       cmp $TMP/$tfile $DIR/$tfile ||
+               error_noexit "Wrong data has been written"
+       rm $DIR/$tfile ||
+               error_noexit "Can't remove file"
+       rm $TMP/$tfile
+}
+run_test 112a "bulk resend while orignal request is in progress"
+
 complete $SECONDS
 check_and_cleanup_lustre
 exit_status