]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid false failures on file systems with smaller NAME_MAX
authorPádraig Brady <P@draigBrady.com>
Tue, 19 Feb 2013 12:06:18 +0000 (12:06 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 20 Feb 2013 04:04:00 +0000 (04:04 +0000)
* tests/du/long-from-unreadable.sh: This test requires a NAME_MAX
of at least 200, so skip the test otherwise.
* tests/rm/deep-2.sh: Likewise.
Reported by C de-Avillez with ecryptfs where NAME_MAX = 143.

tests/du/long-from-unreadable.sh
tests/rm/deep-2.sh

index 18bf384d6995626d5c9e0f01737b78a293ededcc..ac1763a0ecc8a7b25bf625ba5ab659b464e98de2 100755 (executable)
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ du
 
+# ecryptfs for example uses some of the file name space
+# for encrypting filenames, so we must check dynamically.
+name_max=$(stat -f -c %l .)
+test "$name_max" -ge '200' || skip_ "NAME_MAX=$name_max is not sufficient"
+
 proc_file=/proc/self/fd
 if test ! -d $proc_file; then
   skip_ 'This test would fail, since your system lacks /proc support.'
index a03cd965efb78053fa36a56d2a8714687c068654..cb69db28de97704556e8ebcfb5547f0c1db12947 100755 (executable)
@@ -25,6 +25,11 @@ require_perl_
 # the offending euidaccess_stat call.
 skip_if_root_
 
+# ecryptfs for example uses some of the file name space
+# for encrypting filenames, so we must check dynamically.
+name_max=$(stat -f -c %l .)
+test "$name_max" -ge '200' || skip_ "NAME_MAX=$name_max is not sufficient"
+
 mkdir x || framework_failure_
 cd x || framework_failure_