Whamcloud - gitweb
LU-5075 test: keep LFSCK fail_loc until recovery completed
[fs/lustre-release.git] / lustre / tests / sanity-lfsck.sh
index 29c768f..ea3df21 100644 (file)
@@ -19,7 +19,6 @@ init_logging
 
 require_dsh_mds || exit 0
 
-MCREATE=${MCREATE:-mcreate}
 SAVED_MDSSIZE=${MDSSIZE}
 SAVED_OSTSIZE=${OSTSIZE}
 SAVED_OSTCOUNT=${OSTCOUNT}
@@ -44,10 +43,6 @@ setupall
 [[ $(lustre_version_code ost1) -lt $(version_code 2.5.55) ]] &&
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT 11 12 13 14 15 16 17 18 19 20 21"
 
-[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
-# bug number for skipped test:        LU-4970
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 14"
-
 build_test_filter
 
 $LCTL set_param debug=+lfsck > /dev/null || true
@@ -734,6 +729,21 @@ test_8()
        start $SINGLEMDS $MDT_DEVNAME $MOUNT_OPTS_SCRUB > /dev/null ||
                error "(14) Fail to start MDS!"
 
+       local timeout=$(max_recovery_time)
+       local timer=0
+
+       while [ $timer -lt $timeout ]; do
+               STATUS=$(do_facet $SINGLEMDS "$LCTL get_param -n \
+                       mdt.${MDT_DEV}.recovery_status |
+                       awk '/^status/ { print \\\$2 }'")
+               [ "$STATUS" != "RECOVERING" ] && break;
+               sleep 1
+               timer=$((timer + 1))
+       done
+
+       [ $timer != $timeout ] ||
+               error "(14.1) recovery timeout"
+
        STATUS=$($SHOW_NAMESPACE | awk '/^status/ { print $2 }')
        [ "$STATUS" == "crashed" ] ||
                error "(15) Expect 'crashed', but got '$STATUS'"
@@ -756,6 +766,19 @@ test_8()
        start $SINGLEMDS $MDT_DEVNAME $MOUNT_OPTS_SCRUB > /dev/null ||
                error "(19) Fail to start MDS!"
 
+       timer=0
+       while [ $timer -lt $timeout ]; do
+               STATUS=$(do_facet $SINGLEMDS "$LCTL get_param -n \
+                       mdt.${MDT_DEV}.recovery_status |
+                       awk '/^status/ { print \\\$2 }'")
+               [ "$STATUS" != "RECOVERING" ] && break;
+               sleep 1
+               timer=$((timer + 1))
+       done
+
+       [ $timer != $timeout ] ||
+               error "(19.1) recovery timeout"
+
        STATUS=$($SHOW_NAMESPACE | awk '/^status/ { print $2 }')
        [ "$STATUS" == "paused" ] ||
                error "(20) Expect 'paused', but got '$STATUS'"
@@ -1740,8 +1763,7 @@ test_18c() {
 
        if [ $MDSCOUNT -ge 2 ]; then
                $LFS mkdir -i 1 $DIR/$tdir/a2
-               $LFS setstripe -c 2 -i 1 -s 1M $DIR/$tdir/a2
-               do_facet ost2 $LCTL set_param fail_loc=0x1617
+               $LFS setstripe -c 1 -i 0 -s 1M $DIR/$tdir/a2
                dd if=/dev/zero of=$DIR/$tdir/a2/f2 bs=1M count=2
                $LFS getstripe $DIR/$tdir/a2/f2
        fi
@@ -1791,7 +1813,7 @@ test_18c() {
        done
 
        if [ $MDSCOUNT -ge 2 ]; then
-               expected=3
+               expected=2
        else
                expected=1
        fi
@@ -1810,7 +1832,7 @@ test_18c() {
                        error "(5) Expect 0 fixed on mds2, but got: $repaired"
        fi
 
-       echo "There should be some stub under .lustre/lost+found/MDT0001/"
+       echo "There should NOT be some stub under .lustre/lost+found/MDT0001/"
        ls -ail $MOUNT/.lustre/lost+found/MDT0001/*-N-0 &&
                error "(6) .lustre/lost+found/MDT0001/ should be empty"