From 29aaf679afac89359e1b116b8de0480f24b4e8ac Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Fri, 22 Jul 2022 23:02:24 +0800 Subject: [PATCH] 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. Test-Parameters: trivial testlist=sanity-lfsck Signed-off-by: Hongchao Zhang Change-Id: I266d9e2b9c5f37eb9e08b489fab428268b90d895 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48018 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity-lfsck.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index 960b4d3..c4c9fa1 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -1052,8 +1052,13 @@ test_8() #define OBD_FAIL_LFSCK_DELAY2 0x1601 do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1601 - $START_NAMESPACE || + $START_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" ] || -- 1.8.3.1