* [PATCH] common/casefold: Support for tmpfs casefold test
@ 2024-08-23 17:30 André Almeida
2024-08-23 17:35 ` André Almeida
2024-09-11 14:54 ` André Almeida
0 siblings, 2 replies; 3+ messages in thread
From: André Almeida @ 2024-08-23 17:30 UTC (permalink / raw)
To: fstests; +Cc: Zorro Lang, kernel-dev, krisman, André Almeida
Test casefold support for tmpfs.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
common/casefold | 11 +++++++++++
common/rc | 3 +++
tests/generic/556 | 23 +++++++++++++++++------
3 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/common/casefold b/common/casefold
index d9126f4c..8a646ae6 100644
--- a/common/casefold
+++ b/common/casefold
@@ -12,6 +12,9 @@ _has_casefold_kernel_support()
f2fs)
test -f '/sys/fs/f2fs/features/casefold'
;;
+ tmpfs)
+ test -f '/sys/fs/tmpfs/features/casefold'
+ ;;
*)
# defaults to unsupported
false
@@ -52,6 +55,10 @@ _scratch_mkfs_casefold()
f2fs)
_scratch_mkfs -C utf8 $*
;;
+ tmpfs)
+ # there's no mkfs for tmpfs, so we just mount it
+ mount -t tmpfs -o casefold=utf8-12.1.0 tmpfs $SCRATCH_MNT
+ ;;
*)
_notrun "Don't know how to mkfs with casefold support on $FSTYP"
;;
@@ -67,6 +74,10 @@ _scratch_mkfs_casefold_strict()
f2fs)
_scratch_mkfs -C utf8:strict
;;
+ tmpfs)
+ # there's no mkfs for tmpfs, so we just mount it
+ mount -t tmpfs -o casefold=utf8-12.1.0,strict_encoding tmpfs $SCRATCH_MNT
+ ;;
*)
_notrun "Don't know how to mkfs with casefold-strict support on $FSTYP"
;;
diff --git a/common/rc b/common/rc
index afc33bbc..e2f4e4eb 100644
--- a/common/rc
+++ b/common/rc
@@ -374,6 +374,9 @@ _scratch_unmount()
btrfs)
$UMOUNT_PROG $SCRATCH_MNT
;;
+ tmpfs)
+ $UMOUNT_PROG $SCRATCH_MNT
+ ;;
*)
$UMOUNT_PROG $SCRATCH_DEV
;;
diff --git a/tests/generic/556 b/tests/generic/556
index 51d2d482..cbc0146b 100755
--- a/tests/generic/556
+++ b/tests/generic/556
@@ -485,11 +485,20 @@ test_strict_mode_invalid_filename()
_scratch_mkfs_casefold >>$seqres.full 2>&1
-_scratch_mount
-
-_check_dmesg_for \
- "\(${sdev}\): Using encoding defined by superblock: utf8" || \
- _fail "Could not mount with encoding: utf8"
+# casefold tmpfs was already mounted in the mkfs step
+if [ "$FSTYP" != "tmpfs" ]; then
+ _scratch_mount
+fi
+
+if [ "$FSTYP" == "tmpfs" ]; then
+ _check_dmesg_for \
+ "tmpfs: Using encoding provided by mount options: utf8" || \
+ _fail "Could not mount with encoding: utf8"
+else
+ _check_dmesg_for \
+ "\(${sdev}\): Using encoding defined by superblock: utf8" || \
+ _fail "Could not mount with encoding: utf8"
+fi
test_casefold_flag_basic
test_casefold_lookup
@@ -517,7 +526,9 @@ _check_scratch_fs
# Test Strict Mode
_scratch_mkfs_casefold_strict >>$seqres.full 2>&1
-_scratch_mount
+if [ "$FSTYP" != "tmpfs" ]; then
+ _scratch_mount
+fi
test_strict_mode_invalid_filename
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] common/casefold: Support for tmpfs casefold test
2024-08-23 17:30 [PATCH] common/casefold: Support for tmpfs casefold test André Almeida
@ 2024-08-23 17:35 ` André Almeida
2024-09-11 14:54 ` André Almeida
1 sibling, 0 replies; 3+ messages in thread
From: André Almeida @ 2024-08-23 17:35 UTC (permalink / raw)
To: fstests; +Cc: Zorro Lang, kernel-dev, krisman
Em 23/08/2024 14:30, André Almeida escreveu:
> Test casefold support for tmpfs.
>
The kernel side implementation can be find here:
https://lore.kernel.org/linux-fsdevel/20240823173332.281211-1-andrealmeid@igalia.com/
> Signed-off-by: André Almeida <andrealmeid@igalia.com>
> ---
> common/casefold | 11 +++++++++++
> common/rc | 3 +++
> tests/generic/556 | 23 +++++++++++++++++------
> 3 files changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/common/casefold b/common/casefold
> index d9126f4c..8a646ae6 100644
> --- a/common/casefold
> +++ b/common/casefold
> @@ -12,6 +12,9 @@ _has_casefold_kernel_support()
> f2fs)
> test -f '/sys/fs/f2fs/features/casefold'
> ;;
> + tmpfs)
> + test -f '/sys/fs/tmpfs/features/casefold'
> + ;;
> *)
> # defaults to unsupported
> false
> @@ -52,6 +55,10 @@ _scratch_mkfs_casefold()
> f2fs)
> _scratch_mkfs -C utf8 $*
> ;;
> + tmpfs)
> + # there's no mkfs for tmpfs, so we just mount it
> + mount -t tmpfs -o casefold=utf8-12.1.0 tmpfs $SCRATCH_MNT
> + ;;
> *)
> _notrun "Don't know how to mkfs with casefold support on $FSTYP"
> ;;
> @@ -67,6 +74,10 @@ _scratch_mkfs_casefold_strict()
> f2fs)
> _scratch_mkfs -C utf8:strict
> ;;
> + tmpfs)
> + # there's no mkfs for tmpfs, so we just mount it
> + mount -t tmpfs -o casefold=utf8-12.1.0,strict_encoding tmpfs $SCRATCH_MNT
> + ;;
> *)
> _notrun "Don't know how to mkfs with casefold-strict support on $FSTYP"
> ;;
> diff --git a/common/rc b/common/rc
> index afc33bbc..e2f4e4eb 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -374,6 +374,9 @@ _scratch_unmount()
> btrfs)
> $UMOUNT_PROG $SCRATCH_MNT
> ;;
> + tmpfs)
> + $UMOUNT_PROG $SCRATCH_MNT
> + ;;
> *)
> $UMOUNT_PROG $SCRATCH_DEV
> ;;
> diff --git a/tests/generic/556 b/tests/generic/556
> index 51d2d482..cbc0146b 100755
> --- a/tests/generic/556
> +++ b/tests/generic/556
> @@ -485,11 +485,20 @@ test_strict_mode_invalid_filename()
>
> _scratch_mkfs_casefold >>$seqres.full 2>&1
>
> -_scratch_mount
> -
> -_check_dmesg_for \
> - "\(${sdev}\): Using encoding defined by superblock: utf8" || \
> - _fail "Could not mount with encoding: utf8"
> +# casefold tmpfs was already mounted in the mkfs step
> +if [ "$FSTYP" != "tmpfs" ]; then
> + _scratch_mount
> +fi
> +
> +if [ "$FSTYP" == "tmpfs" ]; then
> + _check_dmesg_for \
> + "tmpfs: Using encoding provided by mount options: utf8" || \
> + _fail "Could not mount with encoding: utf8"
> +else
> + _check_dmesg_for \
> + "\(${sdev}\): Using encoding defined by superblock: utf8" || \
> + _fail "Could not mount with encoding: utf8"
> +fi
>
> test_casefold_flag_basic
> test_casefold_lookup
> @@ -517,7 +526,9 @@ _check_scratch_fs
>
> # Test Strict Mode
> _scratch_mkfs_casefold_strict >>$seqres.full 2>&1
> -_scratch_mount
> +if [ "$FSTYP" != "tmpfs" ]; then
> + _scratch_mount
> +fi
>
> test_strict_mode_invalid_filename
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] common/casefold: Support for tmpfs casefold test
2024-08-23 17:30 [PATCH] common/casefold: Support for tmpfs casefold test André Almeida
2024-08-23 17:35 ` André Almeida
@ 2024-09-11 14:54 ` André Almeida
1 sibling, 0 replies; 3+ messages in thread
From: André Almeida @ 2024-09-11 14:54 UTC (permalink / raw)
To: fstests; +Cc: Zorro Lang, kernel-dev, krisman
Em 23/08/2024 14:30, André Almeida escreveu:
> Test casefold support for tmpfs.
>
Due to changes in the kernel side, this diff is required to run the
tests. I will send a proper v2 when the kernel side gets approved.
diff --git a/tests/generic/556 b/tests/generic/556
index cbc0146b..78cdf1bf 100755
--- a/tests/generic/556
+++ b/tests/generic/556
@@ -492,7 +492,7 @@ fi
if [ "$FSTYP" == "tmpfs" ]; then
_check_dmesg_for \
- "tmpfs: Using encoding provided by mount options: utf8" || \
+ "tmpfs: Using encoding" || \
_fail "Could not mount with encoding: utf8"
else
_check_dmesg_for \
> Signed-off-by: André Almeida <andrealmeid@igalia.com>
> ---
> common/casefold | 11 +++++++++++
> common/rc | 3 +++
> tests/generic/556 | 23 +++++++++++++++++------
> 3 files changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/common/casefold b/common/casefold
> index d9126f4c..8a646ae6 100644
> --- a/common/casefold
> +++ b/common/casefold
> @@ -12,6 +12,9 @@ _has_casefold_kernel_support()
> f2fs)
> test -f '/sys/fs/f2fs/features/casefold'
> ;;
> + tmpfs)
> + test -f '/sys/fs/tmpfs/features/casefold'
> + ;;
> *)
> # defaults to unsupported
> false
> @@ -52,6 +55,10 @@ _scratch_mkfs_casefold()
> f2fs)
> _scratch_mkfs -C utf8 $*
> ;;
> + tmpfs)
> + # there's no mkfs for tmpfs, so we just mount it
> + mount -t tmpfs -o casefold=utf8-12.1.0 tmpfs $SCRATCH_MNT
> + ;;
> *)
> _notrun "Don't know how to mkfs with casefold support on $FSTYP"
> ;;
> @@ -67,6 +74,10 @@ _scratch_mkfs_casefold_strict()
> f2fs)
> _scratch_mkfs -C utf8:strict
> ;;
> + tmpfs)
> + # there's no mkfs for tmpfs, so we just mount it
> + mount -t tmpfs -o casefold=utf8-12.1.0,strict_encoding tmpfs $SCRATCH_MNT
> + ;;
> *)
> _notrun "Don't know how to mkfs with casefold-strict support on $FSTYP"
> ;;
> diff --git a/common/rc b/common/rc
> index afc33bbc..e2f4e4eb 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -374,6 +374,9 @@ _scratch_unmount()
> btrfs)
> $UMOUNT_PROG $SCRATCH_MNT
> ;;
> + tmpfs)
> + $UMOUNT_PROG $SCRATCH_MNT
> + ;;
> *)
> $UMOUNT_PROG $SCRATCH_DEV
> ;;
> diff --git a/tests/generic/556 b/tests/generic/556
> index 51d2d482..cbc0146b 100755
> --- a/tests/generic/556
> +++ b/tests/generic/556
> @@ -485,11 +485,20 @@ test_strict_mode_invalid_filename()
>
> _scratch_mkfs_casefold >>$seqres.full 2>&1
>
> -_scratch_mount
> -
> -_check_dmesg_for \
> - "\(${sdev}\): Using encoding defined by superblock: utf8" || \
> - _fail "Could not mount with encoding: utf8"
> +# casefold tmpfs was already mounted in the mkfs step
> +if [ "$FSTYP" != "tmpfs" ]; then
> + _scratch_mount
> +fi
> +
> +if [ "$FSTYP" == "tmpfs" ]; then
> + _check_dmesg_for \
> + "tmpfs: Using encoding provided by mount options: utf8" || \
> + _fail "Could not mount with encoding: utf8"
> +else
> + _check_dmesg_for \
> + "\(${sdev}\): Using encoding defined by superblock: utf8" || \
> + _fail "Could not mount with encoding: utf8"
> +fi
>
> test_casefold_flag_basic
> test_casefold_lookup
> @@ -517,7 +526,9 @@ _check_scratch_fs
>
> # Test Strict Mode
> _scratch_mkfs_casefold_strict >>$seqres.full 2>&1
> -_scratch_mount
> +if [ "$FSTYP" != "tmpfs" ]; then
> + _scratch_mount
> +fi
>
> test_strict_mode_invalid_filename
>
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-11 14:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 17:30 [PATCH] common/casefold: Support for tmpfs casefold test André Almeida
2024-08-23 17:35 ` André Almeida
2024-09-11 14:54 ` André Almeida
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox