From: Fan Yong Date: Mon, 23 Jun 2014 22:02:23 +0000 (+0800) Subject: LU-5075 test: keep LFSCK fail_loc until recovery completed X-Git-Tag: 2.6.52~39 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7bd946c100cda3fd86909647fdf8aace21ef2b29;ds=sidebyside LU-5075 test: keep LFSCK fail_loc until recovery completed In sanity-lfsck test_8, the old script may over wrote the fail_loc before the recovery completed, that will cause the paused LFSCK to be restarted automatically, then the subsequent manual command for starting the LFSCK will get -EALREADY. That is unexpected. Signed-off-by: Fan Yong Change-Id: I8500ecdccf354e83ec70be8dea88943cafa47d81 Reviewed-on: http://review.whamcloud.com/11288 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index 18c6bbb..ea3df21 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -729,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'" @@ -751,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'"