From d3940c62633df3596c06d8a433f860dc60723964 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 16 Jul 2016 14:10:17 +0200 Subject: [PATCH] tests: add maxlen.bash helper Simple script that finds out the maximum supported filename length. --- tests/maxlen.bash | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 tests/maxlen.bash 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