Whamcloud - gitweb
LU-16735 test: cancel MDC locks and wait recovery 38/50638/3
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 14 Apr 2023 11:12:21 +0000 (19:12 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 26 Apr 2023 06:27:58 +0000 (06:27 +0000)
During test_35, the MDC LDLM locks should also be cancelled to
flush the pending operations and the recovery should be waited
to complete before checking the quota.

Test-Parameters: trivial testlist=sanity-quota mdscount=2 mdtcount=4
Change-Id: I6508644976be77ad2895107abf90144b51790cfe
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50638
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/sanity-quota.sh

index f6023f3..d6ab103 100755 (executable)
@@ -3510,7 +3510,7 @@ test_35() {
                error "write failed"
        is_project_quota_supported &&
                change_project -p $TSTPRJID $DIR/$tdir/$tfile
-       cancel_lru_locks osc
+       cancel_lru_locks
 
        echo "Wait for setattr on objects finished..."
        wait_delete_completed
@@ -3546,13 +3546,17 @@ test_35() {
        log "Restart..."
        stopall
        setupall
+       wait_recovery_complete
        quota_init
 
        echo "Verify disk usage after restart"
        local USED=$(getquota -u $TSTID global curspace)
-       [ $USED -eq $ORIG_USR_SPACE ] ||
+       (( $USED == $ORIG_USR_SPACE )) || {
+               ls -al $DIR/$tdir/$tfile
+               $LFS quota -v -u $TSTID $DIR
                error "Used space for user $TSTID changed from " \
                        "$ORIG_USR_SPACE to $USED"
+       }
        USED=$(getquota -u $TSTID global curinodes)
        [ $USED -eq $ORIG_USR_INODES ] ||
                error "Used inodes for user $TSTID changed from " \
@@ -3565,9 +3569,9 @@ test_35() {
        [ $USED -eq $ORIG_GRP_INODES ] ||
                error "Used inodes for group $TSTID changed from " \
                        "$ORIG_GRP_INODES to $USED"
-       if [ $project_supported == "yes" ]; then
+       if [[ $project_supported == "yes" ]]; then
                USED=$(getquota -p $TSTPRJID global curinodes)
-               [ $USED -eq $ORIG_PRJ_INODES ] ||
+               (( $USED == $ORIG_PRJ_INODES )) ||
                        error "Used inodes for project $TSTPRJID " \
                                "changed from $ORIG_PRJ_INODES to $USED"
                USED=$(getquota -p $TSTPRJID global curspace)
@@ -3592,9 +3596,9 @@ test_35() {
        [ $USED -gt $ORIG_GRP_SPACE ] ||
                error "Used space for group $TSTID isn't increased" \
                        "orig:$ORIG_GRP_SPACE, now:$USED"
-       if [ $project_supported == "yes" ]; then
+       if [[ $project_supported == "yes" ]]; then
                USED=$(getquota -p $TSTPRJID global curspace)
-               [ $USED -gt $ORIG_PRJ_SPACE ] ||
+               (( $USED > $ORIG_PRJ_SPACE )) ||
                        error "Used space for project $TSTPRJID isn't " \
                                "increased orig:$ORIG_PRJ_SPACE, now:$USED"
        fi