Test filenames longer than POSIX maximum (#2277)

This commit is contained in:
Andrew Gaul 2023-08-18 08:58:44 +09:00 committed by GitHub
parent 280ed5d706
commit 9fb4c32c6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2533,11 +2533,34 @@ function test_time_mountpoint {
fi fi
} }
function test_file_names_longer_than_posix() {
local DIR_NAME; DIR_NAME=$(basename "${PWD}")
a256="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
#a256="aaaa"
if ! touch "${a256}"; then
echo "could not create long file name"
return 1
fi
rm -f "${a256}"
echo data | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${DIR_NAME}/${a256}"
# shellcheck disable=SC2012
count=$(ls | wc -l)
if [ "${count}" = 0 ]; then
echo "failed to list long file name"
return 1
fi
rm -f "${a256}"
}
function add_all_tests { function add_all_tests {
# shellcheck disable=SC2009 # shellcheck disable=SC2009
if ps u -p "${S3FS_PID}" | grep -q use_cache; then if ps u -p "${S3FS_PID}" | grep -q use_cache; then
add_tests test_cache_file_stat add_tests test_cache_file_stat
add_tests test_zero_cache_file_stat add_tests test_zero_cache_file_stat
else
add_tests test_file_names_longer_than_posix
fi fi
# shellcheck disable=SC2009 # shellcheck disable=SC2009
if ! ps u -p "${S3FS_PID}" | grep -q ensure_diskfree && ! uname | grep -q Darwin; then if ! ps u -p "${S3FS_PID}" | grep -q ensure_diskfree && ! uname | grep -q Darwin; then