On Mon, Aug 04, 2025 at 07:40:15PM +0800, Chao Yu wrote:
> As f2fs changes to use new mount APIs, let's add a new testcase
> to check mount result for all f2fs supported special mount options
> and their combinations, in order to detect any inconsistency during
> mount.
> 
> Cc: Jaegeuk Kim <jaeg...@kernel.org>
> Signed-off-by: Chao Yu <c...@kernel.org>
> ---

This version is good to me,

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

>  tests/f2fs/016     | 50 ++++++++++++++++++++++++++++++++++++++++++++++
>  tests/f2fs/016.out | 33 ++++++++++++++++++++++++++++++
>  2 files changed, 83 insertions(+)
>  create mode 100755 tests/f2fs/016
>  create mode 100644 tests/f2fs/016.out
> 
> diff --git a/tests/f2fs/016 b/tests/f2fs/016
> new file mode 100755
> index 00000000..800f75fc
> --- /dev/null
> +++ b/tests/f2fs/016
> @@ -0,0 +1,50 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2025 Chao Yu.  All Rights Reserved.
> +#
> +# FS QA Test No. f2fs/016
> +#
> +# This testcase tries to check stability of mount result
> +# w/ f2fs special mount options and their combination.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick mount
> +_require_kernel_config CONFIG_F2FS_FS_COMPRESSION
> +_require_kernel_config CONFIG_F2FS_FS_LZO
> +_require_kernel_config CONFIG_F2FS_FS_LZORLE
> +_require_kernel_config CONFIG_F2FS_FS_LZ4
> +_require_kernel_config CONFIG_F2FS_FS_LZ4HC
> +_require_kernel_config CONFIG_F2FS_FS_ZSTD
> +
> +options=(
> +#    mount_option                    mkfs_option
> +     "inline_xattr_size=400"         "extra_attr,flexible_inline_xattr"\
> +     "compress_algorithm=lzo"        "extra_attr,compression"        \
> +     "compress_algorithm=lz4"        "extra_attr,compression"        \
> +     "compress_algorithm=zstd"       "extra_attr,compression"        \
> +     "compress_algorithm=lzo-rle"    "extra_attr,compression"        \
> +     "compress_algorithm=lz4:3"      "extra_attr,compression"        \
> +     "compress_algorithm=zstd:1"     "extra_attr,compression"        \
> +     "compress_log_size=8"           "extra_attr,compression"        \
> +     "compress_extension=so"         "extra_attr,compression"        \
> +     "nocompress_extension=so"       "extra_attr,compression"        \
> +     "nocompress_extension=*"        "extra_attr,compression"        \
> +     "compress_extension=so,nocompress_extension=so"                 \
> +                                     "extra_attr,compression"        \
> +     "compress_chksum"               "extra_attr,compression"        \
> +     "compress_mode=fs"              "extra_attr,compression"        \
> +     "compress_mode=user"            "extra_attr,compression"        \
> +     "compress_cache"                "extra_attr,compression"        \
> +)
> +
> +for ((i=0;i<${#options[@]};i=i+2))
> +do
> +     echo "Option#$i: ${options[$i]} : ${options[$((i+1))]}"
> +     _scratch_mkfs "-O ${options[$((i+1))]}" >> $seqres.full || _fail "mkfs 
> failed"
> +     _try_scratch_mount "-o ${options[$i]}" >> $seqres.full 2>&1
> +     echo $?
> +     _scratch_unmount >> $seqres.full 2>&1
> +done
> +
> +status=0
> +exit
> diff --git a/tests/f2fs/016.out b/tests/f2fs/016.out
> new file mode 100644
> index 00000000..a8c96972
> --- /dev/null
> +++ b/tests/f2fs/016.out
> @@ -0,0 +1,33 @@
> +QA output created by 016
> +Option#0: inline_xattr_size=400 : extra_attr,flexible_inline_xattr
> +0
> +Option#2: compress_algorithm=lzo : extra_attr,compression
> +0
> +Option#4: compress_algorithm=lz4 : extra_attr,compression
> +0
> +Option#6: compress_algorithm=zstd : extra_attr,compression
> +0
> +Option#8: compress_algorithm=lzo-rle : extra_attr,compression
> +0
> +Option#10: compress_algorithm=lz4:3 : extra_attr,compression
> +0
> +Option#12: compress_algorithm=zstd:1 : extra_attr,compression
> +0
> +Option#14: compress_log_size=8 : extra_attr,compression
> +0
> +Option#16: compress_extension=so : extra_attr,compression
> +0
> +Option#18: nocompress_extension=so : extra_attr,compression
> +0
> +Option#20: nocompress_extension=* : extra_attr,compression
> +32
> +Option#22: compress_extension=so,nocompress_extension=so : 
> extra_attr,compression
> +32
> +Option#24: compress_chksum : extra_attr,compression
> +0
> +Option#26: compress_mode=fs : extra_attr,compression
> +0
> +Option#28: compress_mode=user : extra_attr,compression
> +0
> +Option#30: compress_cache : extra_attr,compression
> +0
> -- 
> 2.49.0
> 



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to