From: Eric Sandeen Date: Sat, 24 Dec 2016 10:11:41 +0000 (+0800) Subject: common: add _require_getnextquota helper X-Git-Tag: v2022.05.01~2256 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3b3191806f67f36ed81b3c44d6b9b5fdf79f5846;p=xfstests-dev.git common: add _require_getnextquota helper Add a helper to determine if the kernel supports the GETNEXTQUOTA quotactl. Signed-off-by: Eric Sandeen Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/quota b/common/quota index d9bb8d99..d4ae861d 100644 --- a/common/quota +++ b/common/quota @@ -108,6 +108,16 @@ _require_prjquota() fi } +# +# Do we have GETNEXTQUOTA? Querying ID 0 should work. +# +_require_getnextquota() +{ + _require_test_program "test-nextquota" + $here/src/test-nextquota -i 0 -u -d $SCRATCH_DEV &> $seqres.full || \ + _notrun "No GETNEXTQUOTA support" +} + # # ext4 (for now) is unique in that we must enable the project quota feature # prior to mount. This is a relatively new feature ... diff --git a/tests/generic/244 b/tests/generic/244 index 36c632eb..0c64330e 100755 --- a/tests/generic/244 +++ b/tests/generic/244 @@ -59,10 +59,7 @@ _scratch_mkfs >> $seqres.full 2>&1 TYPES="u g" MOUNT_OPTIONS="-o usrquota,grpquota" _qmount - -# Ok, do we even have GETNEXTQUOTA? Querying ID 0 should work. -$here/src/test-nextquota -i 0 -u -d $SCRATCH_DEV &> $seqres.full || \ - _notrun "No GETNEXTQUOTA support" +_require_getnextquota echo "Launch all quotas" diff --git a/tests/generic/400 b/tests/generic/400 index 1d8d84e9..36eb99b5 100755 --- a/tests/generic/400 +++ b/tests/generic/400 @@ -57,12 +57,8 @@ _require_scratch _scratch_mkfs >> $seqres.full 2>&1 MOUNT_OPTIONS="-o usrquota,grpquota" - _qmount - -# Ok, do we even have GETNEXTQUOTA? Querying ID 0 should work. -$here/src/test-nextquota -i 0 -u -d $SCRATCH_DEV &> $seqres.full || \ - _notrun "No GETNEXTQUOTA support" +_require_getnextquota echo "Launch all quotas"