From: Hongchao Zhang Date: Fri, 22 Jul 2022 15:02:24 +0000 (+0800) Subject: LU-15738 test: check lfsck status before starting X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=779c10b7c64;p=fs%2Flustre-release.git LU-15738 test: check lfsck status before starting If the LFSCK has been started before calling "lfsck_start" to start it, the test shouldn't fail for starting LFSCK. Lustre-change: https://review.whamcloud.com/48018/ Lustre-commit: 29aaf679afac89359e1b116b8de0480f24b4e8ac Test-Parameters: trivial testlist=sanity-lfsck Signed-off-by: Hongchao Zhang Change-Id: I266d9e2b9c5f37eb9e08b489fab428268b90d895 Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48841 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index c1fd324..32c2abd 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -1033,6 +1033,12 @@ test_8() #define OBD_FAIL_LFSCK_DELAY2 0x1601 do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1601 $START_NAMESPACE || error "(16) Fail to start LFSCK for namespace!" + sleep 1 + [ -n "$($SHOW_NAMESPACE | + grep -E "status: init|status: completed")" ] && { + $START_NAMESPACE || + namespace_error "(16) Fail to start LFSCK for namespace!" + } || echo "lfsck for namespace has been started" STATUS=$($SHOW_NAMESPACE | awk '/^status/ { print $2 }') [ "$STATUS" == "scanning-phase1" ] ||