Whamcloud - gitweb
LU-13284 tests: few tests miss MDS_MOUNT_OPTS/OST_MOUNT_OPTS
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index ab8fcfe..c5166e9 100755 (executable)
@@ -1069,6 +1069,8 @@ test_26a() {      # was test_26 bug 5921 - evict dead exports by pinger
 
        check_timeout || return 1
 
+       # make sure all imports are connected and not IDLE
+       do_facet client lfs df > /dev/null
 # OBD_FAIL_PTLRPC_DROP_RPC 0x505
        do_facet client lctl set_param fail_loc=0x505
        local before=$(date +%s)
@@ -1079,7 +1081,7 @@ test_26a() {      # was test_26 bug 5921 - evict dead exports by pinger
        # the loser might have to wait for the next ping.
        sleep $((TIMEOUT * 2 + TIMEOUT * 3 / 4))
        do_facet client lctl set_param fail_loc=0x0
-       do_facet client df > /dev/null
+       do_facet client lfs df > /dev/null
 
        local oscs=$(lctl dl | awk '/-osc-/ {print $4}')
        check_clients_evicted $before ${oscs[@]}
@@ -1117,10 +1119,9 @@ test_26b() {      # bug 10140 - evict dead exports by pinger
        # = 9 * PING_INTERVAL + PING_INTERVAL
        # = 10 PING_INTERVAL = 10 obd_timeout / 4 = 2.5 obd_timeout
        # let's wait $((TIMEOUT * 3)) # bug 19887
-       local rc=0
-       wait_client_evicted ost1 $OST_NEXP $((TIMEOUT * 3)) || \
-               error "Client was not evicted by ost" rc=1
-       wait_client_evicted $SINGLEMDS $MDS_NEXP $((TIMEOUT * 3)) || \
+       wait_client_evicted ost1 $OST_NEXP $((TIMEOUT * 3)) ||
+               error "Client was not evicted by ost"
+       wait_client_evicted $SINGLEMDS $MDS_NEXP $((TIMEOUT * 3)) ||
                error "Client was not evicted by mds"
 }
 run_test 26b "evict dead exports"
@@ -2889,7 +2890,7 @@ test_138() {
        sleep 55
        stop $SINGLEMDS || error "stop MDS failed"
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0
-       start $SINGLEMDS $(mdsdevname ${SINGLEMDS//mds/}) ||
+       start $SINGLEMDS $(mdsdevname ${SINGLEMDS//mds/}) $MDS_MOUNT_OPTS ||
                error "start MDS failed"
        zconf_mount_clients $CLIENTS $MOUNT
 }
@@ -2928,7 +2929,7 @@ test_140a() {
        mount_mds_client
 
        local cnt
-       cnt=$(do_facet mds1 $LCTL get_param "mdt.*.exports.*.export" |
+       cnt=$(do_facet mds1 $LCTL get_param "mdt.*MDT0000.exports.*.export" |
                grep export_flags.*no_recovery | wc -l)
        echo "$cnt clients with recovery disabled"
        umount_mds_client
@@ -2939,7 +2940,7 @@ test_140a() {
        do_facet mds1 $LCTL set_param mdt.*.local_recovery=1
        mount_mds_client
 
-       cnt=$(do_facet mds1 $LCTL get_param "mdt.*.exports.*.export" |
+       cnt=$(do_facet mds1 $LCTL get_param "mdt.*MDT0000.exports.*.export" |
                grep export_flags.*no_recovery | wc -l)
        echo "$cnt clients with recovery disabled"
        umount_mds_client
@@ -2966,11 +2967,12 @@ test_140b() {
        replay_barrier mds1
        umount_mds_client
        fail mds1
+       # Lustre: tfs-MDT0000: Recovery over after 0:03, of 2 clients 2 rec...
        local recovery=$(do_facet mds1 dmesg |
-                        awk -F: '/Recovery over after/ { print $4 }' |
-                        cut -d, -f1 | tail -1)
-       (( $recovery < $TIMEOUT*2 )) ||
-               error "recovery took too long $recovery > $((TIMEOUT * 2))"
+                        awk '/Recovery over after/ { print $6 }' | tail -1 |
+                        awk -F: '{ print $1 * 60 + $2 }')
+       (( recovery < TIMEOUT * 2 + 5 )) ||
+               error "recovery took too long $recovery > $((TIMEOUT * 2 + 5))"
 }
 run_test 140b "local mount is excluded from recovery"
 
@@ -3107,6 +3109,51 @@ test_147() {
 }
 run_test 147 "Check client reconnect"
 
+test_148() {
+       local wce_param="obdfilter.$FSNAME-OST0000.writethrough_cache_enable"
+       local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
+       local amc=$(at_max_get client)
+       local amo=$(at_max_get ost1)
+       local timeout
+
+       at_max_set 0 client
+       at_max_set 0 ost1
+       timeout=$(request_timeout client)
+
+       [ "$(facet_fstype ost1)" = "ldiskfs" ] && {
+               # save old r/o cache settings
+               save_lustre_params ost1 $wce_param > $p
+
+               # disable r/o cache
+               do_facet ost1 "$LCTL set_param -n $wce_param=0"
+       }
+
+       $LFS setstripe -i 0 -c 1 $DIR/$tfile
+       dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 oflag=direct
+       cp $DIR/$tfile $TMP/$tfile
+       #define OBD_FAIL_OST_BRW_PAUSE_BULK2     0x227
+       do_facet ost1 $LCTL set_param fail_loc=0x80000227
+       do_facet ost1 $LCTL set_param fail_val=$((timeout+2))
+       dd if=/dev/urandom of=$DIR/$tfile bs=4096 count=1 conv=notrunc,fdatasync
+       dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 conv=notrunc,fdatasync
+       sleep 2
+       cancel_lru_locks osc
+       cmp -b $DIR/$tfile $TMP/$tfile || error "wrong data"
+
+       rm -f $DIR/$tfile $TMP/$tfile
+
+       at_max_set $amc client
+       at_max_set $amo ost1
+
+       [ "$(facet_fstype ost1)" = "ldiskfs" ] && {
+               # restore initial r/o cache settings
+               restore_lustre_params < $p
+       }
+
+       return 0
+}
+run_test 148 "data corruption through resend"
+
 complete $SECONDS
 check_and_cleanup_lustre
 exit_status