diff mbox series

[4/5] ext4/054: skip test if the dax mount option is enabled

Message ID 20220625030718.1215980-5-tytso@mit.edu (mailing list archive)
State New, archived
Headers show
Series Misceillaneous ext4 test fix ups | expand

Commit Message

Theodore Ts'o June 25, 2022, 3:07 a.m. UTC
The ext4/054 test explicitly creates a file system with a 1k
blocksize.  This can't possibly work on if the dax mount option is
enabled, so change ext4/054 to use _scratch_mkfs_blocksized, and and a
check to _scratch_mkfs_blocksized to _notrun the test if the block
size is less than the page size.

Also remove an unnecessary _require_test declaration since this test
does not use the test device.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 common/rc      | 3 +++
 tests/ext4/054 | 5 ++---
 2 files changed, 5 insertions(+), 3 deletions(-)

Comments

Zorro Lang June 28, 2022, 4:39 a.m. UTC | #1
On Fri, Jun 24, 2022 at 11:07:17PM -0400, Theodore Ts'o wrote:
> The ext4/054 test explicitly creates a file system with a 1k
> blocksize.  This can't possibly work on if the dax mount option is
> enabled, so change ext4/054 to use _scratch_mkfs_blocksized, and and a
> check to _scratch_mkfs_blocksized to _notrun the test if the block
> size is less than the page size.
> 
> Also remove an unnecessary _require_test declaration since this test
> does not use the test device.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---

Looks good to me.

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  common/rc      | 3 +++
>  tests/ext4/054 | 5 ++---
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 9378ff26..3014f5fc 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1220,6 +1220,9 @@ _scratch_mkfs_blocksized()
>  	if ! [[ $blocksize =~ $re ]] ; then
>  		_notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer."
>  	fi
> +	if [ $blocksize -lt $(get_page_size) ]; then
> +		_exclude_scratch_mount_option dax
> +	fi
>  
>  	case $FSTYP in
>  	btrfs)
> diff --git a/tests/ext4/054 b/tests/ext4/054
> index 9a11719f..e23acbb1 100755
> --- a/tests/ext4/054
> +++ b/tests/ext4/054
> @@ -19,7 +19,6 @@ _begin_fstest auto quick dangerous_fuzzers
>  
>  # real QA test starts here
>  _supported_fs ext4
> -_require_test
>  _require_scratch_nocheck
>  _require_xfs_io_command "falloc"
>  _require_xfs_io_command "pwrite"
> @@ -28,8 +27,8 @@ _require_xfs_io_command "fpunch"
>  _require_command "$DEBUGFS_PROG" debugfs
>  
>  # In order to accurately construct the damaged extent in the following
> -# test steps, the blocksize is set to 1024 here
> -_scratch_mkfs "-b 1024" > $seqres.full 2>&1
> +# test steps, the block size is set to 1024 here
> +_scratch_mkfs_blocksized 1024 >> $seqres.full 2>&1
>  _scratch_mount
>  
>  TEST_FILE="${SCRATCH_MNT}/testfile"
> -- 
> 2.31.0
>
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 9378ff26..3014f5fc 100644
--- a/common/rc
+++ b/common/rc
@@ -1220,6 +1220,9 @@  _scratch_mkfs_blocksized()
 	if ! [[ $blocksize =~ $re ]] ; then
 		_notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer."
 	fi
+	if [ $blocksize -lt $(get_page_size) ]; then
+		_exclude_scratch_mount_option dax
+	fi
 
 	case $FSTYP in
 	btrfs)
diff --git a/tests/ext4/054 b/tests/ext4/054
index 9a11719f..e23acbb1 100755
--- a/tests/ext4/054
+++ b/tests/ext4/054
@@ -19,7 +19,6 @@  _begin_fstest auto quick dangerous_fuzzers
 
 # real QA test starts here
 _supported_fs ext4
-_require_test
 _require_scratch_nocheck
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "pwrite"
@@ -28,8 +27,8 @@  _require_xfs_io_command "fpunch"
 _require_command "$DEBUGFS_PROG" debugfs
 
 # In order to accurately construct the damaged extent in the following
-# test steps, the blocksize is set to 1024 here
-_scratch_mkfs "-b 1024" > $seqres.full 2>&1
+# test steps, the block size is set to 1024 here
+_scratch_mkfs_blocksized 1024 >> $seqres.full 2>&1
 _scratch_mount
 
 TEST_FILE="${SCRATCH_MNT}/testfile"