On 02/18/2013 11:27 PM, C de-Avillez wrote:
For the ecryptfs FS:

$ stat -f -c %l .
143
  python -c "import os; print os.pathconf('.','PC_PATH_MAX')"
4096

For a standard ext4:

$ stat -f -c %l .
255
$ python -c "import os; print os.pathconf('.','PC_PATH_MAX')"
4096

So ecrypts limits NAME_MAX. Indeed, running the perl snippet with $dir
set to 142 works.

OK I'll take the simple approach and skip those tests in that case.
Patch attached.

thanks,
Pádraig.

>From adf548a98f766398998d3f3acc9023e425d6e365 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Tue, 19 Feb 2013 12:06:18 +0000
Subject: [PATCH] tests: avoid false failures on file systems with smaller
 NAME_MAX

* 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 |    5 +++++
 tests/rm/deep-2.sh               |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/tests/du/long-from-unreadable.sh b/tests/du/long-from-unreadable.sh
index 18bf384..ac1763a 100755
--- a/tests/du/long-from-unreadable.sh
+++ b/tests/du/long-from-unreadable.sh
@@ -31,6 +31,11 @@
 . "${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.'
diff --git a/tests/rm/deep-2.sh b/tests/rm/deep-2.sh
index a03cd96..cb69db2 100755
--- a/tests/rm/deep-2.sh
+++ b/tests/rm/deep-2.sh
@@ -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_
 
-- 
1.7.7.6

Reply via email to