generic/594: require setquota tool supports project quota
authorZorro Lang <zlang@redhat.com>
Sun, 19 Apr 2020 10:49:36 +0000 (18:49 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 19 Apr 2020 16:46:10 +0000 (00:46 +0800)
The old setquota tool doesn't support project quota, it doesn't has
"-P, --project" option. So _notrun the test to avoid a failure.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/quota
tests/generic/594

index 4e07fef1569794ab29c301ed759ec8b41c3ef4d1..240e0bbc5dd41773e780521f0956f7aaa92a8079 100644 (file)
@@ -124,6 +124,15 @@ _scratch_enable_pquota()
        esac
 }
 
+_require_setquota_project()
+{
+       setquota --help 2>&1 | \
+               grep -q "\-P, \-\-project[[:space:]]*set limits for project"
+       if [ "$?" -ne 0 ];then
+               _notrun "setquota doesn't support project quota (-P)"
+       fi
+}
+
 #
 # checks for user nobody in /etc/passwd and /etc/group.
 #
index e501d54c069e7310c54d342f72cfafba12287c37..2665e5b45bdaacd1c98f2fa3912ed3e0c43e7c66 100755 (executable)
@@ -34,6 +34,7 @@ rm -f $seqres.full
 _supported_fs generic
 _supported_os Linux
 _require_scratch
+_require_setquota_project
 # V4 XFS doesn't support to mount project and group quota together
 if [ "$FSTYP" = "xfs" ];then
        _require_scratch_xfs_crc