Hello,

checking coreutils 8.24, running on NFS, the test 'ls/stat-failed' fails (log 
attached).

If I understand correctly,
The test creates a symlink to a directory then removes execute permissions:
   mkdir d
   ln -s / d/s
   chmod 600 d

Then tries to dereference it:
    $ ls -Log d
    ls: cannot access d/s: Permission denied
    total 0
    d????????? ? ?            ? s

The test expect 's' to have 'l' type, on my system it is 'd'.

The attached patch avoids the failure, though I don't know if this is correct 
or not (perhaps this failure should not be avoided?).

The system is:
    $ uname -a
    Linux XXX 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 
x86_64 x86_64 GNU/Linux
    $ gcc --version
     gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)

The file system is NFS.


regards,
 - assaf
================================================
   GNU coreutils 8.24: ./tests/test-suite.log
================================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/ls/stat-failed
==========================

++ initial_cwd_=/data/research/erlich_lab/gordon/sources/coreutils-8.24
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /data/research/erlich_lab/gordon/sources/coreutils-8.24 gt-stat-failed.sh.XXXX
+++ case $# in
+++ destdir_=/data/research/erlich_lab/gordon/sources/coreutils-8.24
+++ template_=gt-stat-failed.sh.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
++++ unset TMPDIR
+++ d=/data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ
+++ case $d in
+++ test -d /data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ
++++ tr S -
+++ perms='drwx------ 2 0 Jul 24 16:48 /data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ'
+++ case $perms in
+++ test 0 = 0
+++ echo /data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ
+++ return
++ test_dir_=/data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ
++ cd /data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/data/research/erlich_lab/gordon/sources/coreutils-8.24/./src
+ case $abs_path_dir_ in
+ PATH=/data/research/erlich_lab/gordon/sources/coreutils-8.24/./src:/data/research/erlich_lab/gordon/sources/coreutils-8.24/src:/nethome/agordon/usr/bin:/opt/sge/bin:/opt/sge/bin/lx-amd64:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
+ create_exe_shims_ /data/research/erlich_lab/gordon/sources/coreutils-8.24/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ ls
+ test yes = yes
+ local i
+ for i in '$*'
+ env ls --version
ls (GNU coreutils) 8.24
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.
+ skip_if_root_
+ uid_is_privileged_
++ id -u
+ my_uid=10346
+ case $my_uid in
+ return 1
+ LS_MINOR_PROBLEM=1
+ mkdir d
+ ln -s / d/s
+ chmod 600 d
+ ls -Log d
ls: cannot access d/s: Permission denied
+ test 1 = 1
+ cat
+ sed 's/^l/?/' out
+ compare exp -
+ compare_dev_null_ exp -
+ test 2 = 2
+ test xexp = x/dev/null
+ test x- = x/dev/null
+ return 2
+ case $? in
+ compare_ exp -
+ diff -u exp -
--- exp	2015-07-24 16:48:36.152677768 -0400
+++ -	2015-07-24 16:48:36.172187132 -0400
@@ -1,2 +1,2 @@
 total 0
-?????????? ? ?            ? s
+d????????? ? ?            ? s
+ fail=1
+ rm -f out exp
+ returns_ 1 ls --dired -l d
ls: cannot access d/s: Permission denied
+ cat
+ sed 's/^  l/  ?/' out
+ compare exp -
+ compare_dev_null_ exp -
+ test 2 = 2
+ test xexp = x/dev/null
+ test x- = x/dev/null
+ return 2
+ case $? in
+ compare_ exp -
+ diff -u exp -
--- exp	2015-07-24 16:48:36.262522027 -0400
+++ -	2015-07-24 16:48:36.270381375 -0400
@@ -1,4 +1,4 @@
   total 0
-  ?????????? ? ? ? ?            ? s
+  d????????? ? ? ? ?            ? s
 //DIRED// 44 45
 //DIRED-OPTIONS// --quoting-style=literal
+ fail=1
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ cd /data/research/erlich_lab/gordon/sources/coreutils-8.24
+ chmod -R u+rwx /data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ
+ rm -rf /data/research/erlich_lab/gordon/sources/coreutils-8.24/gt-stat-failed.sh.LdZJ
+ exit 1
FAIL tests/ls/stat-failed.sh (exit status: 1)

>From 213564fc8c82cd5c48a1572b1a35e1780a4f245a Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgor...@gmail.com>
Date: Fri, 24 Jul 2015 17:27:04 -0400
Subject: [PATCH] tests: avoid test failure for ls/stat-failed.sh

* tests/ls/stat-failed.sh: accept 'l' or 'd' as indication for a symlink
  for a directory inside a directory with no access on NFS.
---
 tests/ls/stat-failed.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/ls/stat-failed.sh b/tests/ls/stat-failed.sh
index 002b71c..f177ed17 100755
--- a/tests/ls/stat-failed.sh
+++ b/tests/ls/stat-failed.sh
@@ -36,7 +36,7 @@ total 0
 ?????????? ? ?            ? s
 EOF
 
-sed 's/^l/?/' out | compare exp - || fail=1
+sed 's/^[ld]/?/' out | compare exp - || fail=1
 
 # Ensure that the offsets in --dired output are accurate.
 rm -f out exp
@@ -49,6 +49,6 @@ cat <<\EOF > exp || fail=1
 //DIRED-OPTIONS// --quoting-style=literal
 EOF
 
-sed 's/^  l/  ?/' out | compare exp - || fail=1
+sed 's/^  [ld]/  ?/' out | compare exp - || fail=1
 
 Exit $fail
-- 
1.9.1

Reply via email to