Whamcloud - gitweb
EX-5909 tests: clean up in sanity-quota/16a
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Oct 2022 22:04:53 +0000 (16:04 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 27 Oct 2022 03:15:32 +0000 (03:15 +0000)
Clean up the test file in sanity-quota test_16a.  If test_16b is
run (DNE config) then the filesystem is reformatted, but in the
non-DNE config test_17 will fail if there is used quota.

Test-Parameters: trivial testlist=sanity-quota
Fixes: b54b7ce43929 ("LU-14472 quota: skip non-exist or inact tgt for lfs_quota")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Id1faeab9df246d8010bf114582ab17a75846db68
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48899
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/sanity-quota.sh

index 9897736..491ea0e 100755 (executable)
@@ -2534,11 +2534,16 @@ test_16a()
 
        setup_quota_test || error "setup quota failed with $?"
 
+       # make sure the system is clean
+       local used=$(getquota -u $TSTUSR global curspace)
+       [[ "$used" == "0" ]] || error "Used space($used) for user $TSTUSR not 0"
+
        $LFS setquota -u $TSTUSR -B 500M -I 10K $MOUNT ||
                error "failed to set quota for user $TSTUSR"
        $LFS setquota -g $TSTUSR -B 500M -I 10K $MOUNT ||
                error "failed to set quota for group $TSTUSR"
 
+       stack_trap "rm -f $DIR/$tdir/$tfile"
        $RUNAS $DD of=$DIR/$tdir/$tfile bs=1M count=50 ||
                quota_error u $TSTUSR "write failure"