Whamcloud - gitweb
LU-15738 test: check lfsck status before starting
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 22 Jul 2022 15:02:24 +0000 (23:02 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Oct 2022 20:03:07 +0000 (20:03 +0000)
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 <hongchao@whamcloud.com>
Change-Id: I266d9e2b9c5f37eb9e08b489fab428268b90d895
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48841
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-lfsck.sh

index c1fd324..32c2abd 100644 (file)
@@ -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" ] ||