]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: prefer ext4 casefold for case insensitive tests
authorPádraig Brady <P@draigBrady.com>
Thu, 27 Nov 2025 21:52:20 +0000 (21:52 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 28 Nov 2025 12:38:23 +0000 (12:38 +0000)
* tests/mv/hardlink-case.sh: Try both ext4 casefold and hfsplus,
as ext4 has better availability.
Suggested at https://github.com/coreutils/coreutils/issues/133

tests/mv/hardlink-case.sh

index 2884af6eb59890ea3617cfc5ef6074d9a3353000..da182b106c477be8e652a2cbba606f9ec1b02527 100755 (executable)
@@ -23,10 +23,22 @@ require_root_
 cwd=$(pwd)
 cleanup_() { cd /; umount "$cwd/mnt"; }
 
-truncate -s100M hfs.img || framework_failure_
-mkfs -t hfsplus hfs.img || skip_ 'failed to create hfs file system'
-mkdir mnt               || framework_failure_
-mount hfs.img mnt       || skip_ 'failed to mount hfs file system'
+for ocase in '-t ext4 -O casefold' '-t hfsplus'; do
+  rm -f case.img
+  truncate -s100M case.img || framework_failure_
+  mkfs $ocase case.img &&
+  mkdir mnt &&
+  mount case.img mnt &&
+  printf '%s\n' "$ocase" > mnt/type  &&
+  break
+done
+
+test -f mnt/type || skip_ 'failed to create case insensitive file system'
+
+if grep 'ext4' mnt/type; then
+  rm -d mnt/type mnt/lost+found || framework_failure_
+  chattr +F mnt || skip_ 'failed to create case insensitive file system'
+fi
 
 cd mnt
 touch foo