common: add _require_getnextquota helper
authorEric Sandeen <sandeen@sandeen.net>
Sat, 24 Dec 2016 10:11:41 +0000 (18:11 +0800)
committerEryu Guan <eguan@redhat.com>
Sat, 24 Dec 2016 10:12:10 +0000 (18:12 +0800)
Add a helper to determine if the kernel supports
the GETNEXTQUOTA quotactl.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/quota
tests/generic/244
tests/generic/400

index d9bb8d99a27562cefbebde2c61c680217d543187..d4ae861ddddb297679ca4eafab8c08b120c13519 100644 (file)
@@ -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 ...
index 36c632eb38f6f5e72d1d478c9fb9832348cc2f86..0c64330e183f16e8fac74b8784df3012ed2822c5 100755 (executable)
@@ -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"
 
index 1d8d84e90106d4e55f76abe169926ceb21964d03..36eb99b5574a8d8be72856a46f80940c55e58d43 100755 (executable)
@@ -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"