diff mbox series

[V2] fstests: test for CONFIG_QFMT_V2 in _require_quota

Message ID 5637d8c8-d92e-43b0-95b6-a8decc5e2025@redhat.com (mailing list archive)
State New
Headers show
Series [V2] fstests: test for CONFIG_QFMT_V2 in _require_quota | expand

Commit Message

Eric Sandeen March 14, 2025, 3:44 p.m. UTC
When CONFIG_QUOTA is enabled but CONFIG_QFMT_V2 is disabled in the
kernel config, many quota tests on ext4 will fail in odd ways,
when in fact they should be _notrun. Add a CONFIG_QFMT_V2 test to
_require_quota() to catch this for filesystems that require it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---

V2: add _require_quota to ext4/055, because it adds the -O quota
feature at mkfs time, and mount fails without CONFIG_QFMT_V2.
Jan, I took the liberty of leaving your RVB: despite that minor change,
please let me know if you object. Thanks!

Comments

Bill O'Donnell March 14, 2025, 4:15 p.m. UTC | #1
On Fri, Mar 14, 2025 at 10:44:16AM -0500, Eric Sandeen wrote:
> When CONFIG_QUOTA is enabled but CONFIG_QFMT_V2 is disabled in the
> kernel config, many quota tests on ext4 will fail in odd ways,
> when in fact they should be _notrun. Add a CONFIG_QFMT_V2 test to
> _require_quota() to catch this for filesystems that require it.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> Reviewed-by: Jan Kara <jack@suse.cz>

Looks fine.
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>


> ---
> 
> V2: add _require_quota to ext4/055, because it adds the -O quota
> feature at mkfs time, and mount fails without CONFIG_QFMT_V2.
> Jan, I took the liberty of leaving your RVB: despite that minor change,
> please let me know if you object. Thanks!
> 
> diff --git a/common/quota b/common/quota
> index e306e2e3..a51386b1 100644
> --- a/common/quota
> +++ b/common/quota
> @@ -16,6 +16,7 @@ _require_quota()
>  	if [ ! -d /proc/sys/fs/quota ]; then
>  	    _notrun "Installed kernel does not support quotas"
>  	fi
> +	_require_kernel_config CONFIG_QFMT_V2
>  	;;
>      gfs2|ocfs2|bcachefs)
>  	;;
> diff --git a/tests/ext4/053 b/tests/ext4/053
> index 5922ed57..77b3ac81 100755
> --- a/tests/ext4/053
> +++ b/tests/ext4/053
> @@ -45,7 +45,6 @@ _require_loop
>  _require_command "$TUNE2FS_PROG" tune2fs
>  MKE2FS_PROG=$(type -P mke2fs)
>  _require_command "$MKE2FS_PROG" mke2fs
> -_require_kernel_config CONFIG_QFMT_V2
>  
>  LOG=""
>  print_log() {
> diff --git a/tests/ext4/055 b/tests/ext4/055
> index 3117bf15..711d18c2 100755
> --- a/tests/ext4/055
> +++ b/tests/ext4/055
> @@ -14,6 +14,7 @@
>  # The test is based on a testcase from Zhang Yi <yi.zhang@huawei.com>.
>  #
>  . ./common/preamble
> +. ./common/quota
>  _begin_fstest auto quota
>  
>  _exclude_fs ext2
> @@ -23,6 +24,7 @@ _require_scratch_nocheck
>  _require_user fsgqa
>  _require_user fsgqa2
>  _require_command "$DEBUGFS_PROG" debugfs
> +_require_quota
>  
>  echo "Silence is golden"
>  
> 
>
diff mbox series

Patch

diff --git a/common/quota b/common/quota
index e306e2e3..a51386b1 100644
--- a/common/quota
+++ b/common/quota
@@ -16,6 +16,7 @@  _require_quota()
 	if [ ! -d /proc/sys/fs/quota ]; then
 	    _notrun "Installed kernel does not support quotas"
 	fi
+	_require_kernel_config CONFIG_QFMT_V2
 	;;
     gfs2|ocfs2|bcachefs)
 	;;
diff --git a/tests/ext4/053 b/tests/ext4/053
index 5922ed57..77b3ac81 100755
--- a/tests/ext4/053
+++ b/tests/ext4/053
@@ -45,7 +45,6 @@  _require_loop
 _require_command "$TUNE2FS_PROG" tune2fs
 MKE2FS_PROG=$(type -P mke2fs)
 _require_command "$MKE2FS_PROG" mke2fs
-_require_kernel_config CONFIG_QFMT_V2
 
 LOG=""
 print_log() {
diff --git a/tests/ext4/055 b/tests/ext4/055
index 3117bf15..711d18c2 100755
--- a/tests/ext4/055
+++ b/tests/ext4/055
@@ -14,6 +14,7 @@ 
 # The test is based on a testcase from Zhang Yi <yi.zhang@huawei.com>.
 #
 . ./common/preamble
+. ./common/quota
 _begin_fstest auto quota
 
 _exclude_fs ext2
@@ -23,6 +24,7 @@  _require_scratch_nocheck
 _require_user fsgqa
 _require_user fsgqa2
 _require_command "$DEBUGFS_PROG" debugfs
+_require_quota
 
 echo "Silence is golden"