Whamcloud - gitweb
LU-15738 test: check lfsck status before starting 18/48018/3
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 22 Jul 2022 15:02:24 +0000 (23:02 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Oct 2022 05:37:21 +0000 (05:37 +0000)
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 <hongchao@whamcloud.com>
Change-Id: I266d9e2b9c5f37eb9e08b489fab428268b90d895
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48018
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-lfsck.sh

index 960b4d3..c4c9fa1 100644 (file)
@@ -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" ] ||