tests: add maxlen.bash helper

Simple script that finds out the maximum supported filename
length.
This commit is contained in:
Jakob Unterwurzacher 2016-07-16 14:10:17 +02:00
parent e98c51afd6
commit d3940c6263
1 changed files with 18 additions and 0 deletions

18
tests/maxlen.bash Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash -eu
#
# Find out the maximum supported filename length and print it.
#
# Part of the gocryptfs test suite
# https://nuetzlich.net/gocryptfs/
NAME="maxlen."
LEN=7
while [ $LEN -le 10000 ]; do
touch $NAME 2> /dev/null || break
rm $NAME
NAME="${NAME}x"
let LEN=LEN+1
done
echo $LEN