generic/556: Fix rename test
authorAndré Almeida <andrealmeid@collabora.com>
Wed, 24 Mar 2021 22:48:17 +0000 (19:48 -0300)
committerEryu Guan <guaneryu@gmail.com>
Sun, 28 Mar 2021 15:19:04 +0000 (23:19 +0800)
Casefold rename test should check if renaming a file to an equivalent
name fails as expect (e.g. renaming from "file.txt" to "FILE.TXT") and
`mv` correctly identifies that those names refers to the same file.
Currently, the test doesn't do what is expected given that it doesn't
have the file to be renamed, and `mv` returns "No such file or
directory". Fix that by creating test files and checking the correct
output.

Fixes: 12b7dddbc265fcb ("generic: Add tests for filename casefolding feature")
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/556
tests/generic/556.out

index 3efd0510399ac84bea57a40095f3178a96c136a1..3145188c0baea67324796a8875136a8878343c77 100755 (executable)
@@ -341,8 +341,10 @@ test_file_rename()
        mkdir -p ${basedir}
        _casefold_set_attr ${basedir}
 
+       touch ${basedir}/rename
+
        # Move to an equivalent name should not work
-       mv ${basedir}/rename ${basedir}/rename 2>&1 | \
+       mv ${basedir}/rename ${basedir}/RENAME 2>&1 | \
                _filter_scratch
 
        _casefold_check_exact_name ${basedir} "rename" || \
index 476560657311f3a4f400c1c20adc526df2173f2c..f9dd9542fb120533a007dc83a6e4284a6532dd52 100644 (file)
@@ -5,7 +5,7 @@ SCRATCH_MNT/casefold_flag_removal Casefold
 SCRATCH_MNT/casefold_flag_removal Casefold
 SCRATCH_MNT/flag_inheritance/d1/d2/d3 Casefold
 SCRATCH_MNT/symlink/ind1/TARGET
-mv: cannot stat 'SCRATCH_MNT/rename/rename': No such file or directory
+mv: 'SCRATCH_MNT/rename/rename' and 'SCRATCH_MNT/rename/RENAME' are the same file
 # file: SCRATCH_MNT/xattrs/x
 user.foo="bar"