summaryrefslogtreecommitdiff
path: root/tests/maxlen.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-07-16 14:10:17 +0200
committerJakob Unterwurzacher2016-07-16 14:10:17 +0200
commitd3940c62633df3596c06d8a433f860dc60723964 (patch)
tree3e302d35bc71d37cccc505e42ce35ffe0739cc05 /tests/maxlen.bash
parente98c51afd6870c73d5006a22cff5322c2f4d0ba7 (diff)
tests: add maxlen.bash helper
Simple script that finds out the maximum supported filename length.
Diffstat (limited to 'tests/maxlen.bash')
-rwxr-xr-xtests/maxlen.bash18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/maxlen.bash b/tests/maxlen.bash
new file mode 100755
index 0000000..f009df2
--- /dev/null
+++ b/tests/maxlen.bash
@@ -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