]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
ls: port removed-directory test to NFS
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 21 May 2020 00:09:03 +0000 (17:09 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 21 May 2020 00:32:53 +0000 (17:32 -0700)
* tests/ls/removed-directory.sh:
Port test to NFS, where one gets a stale file handle
when looking at a removed directory.

tests/ls/removed-directory.sh

index 63b209dee7ca7c5074388b580cf2b63b0b66f141..319594907a70fcff3a15a1cc884aa790d9e6686d 100755 (executable)
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ ls
 
-cwd=$(pwd)
 mkdir d || framework_failure_
-cd d || framework_failure_
-rmdir ../d || skip_ "can't remove working directory on this platform"
+(cd d || exit 10
+ rmdir ../d || exit 11
+ test -d . || exit 12
+ ls || exit 13) >out 2>err
+case $? in
+  11) skip_ "can't remove working directory on this platform";;
+  12) skip_ "can't examine removed working directory on this platform";;
+  13) fail=1;;
+  * ) framework_failure_;;
+esac
 
-ls >../out 2>../err || fail=1
-cd "$cwd" || framework_failure_
 compare /dev/null out || fail=1
 compare /dev/null err || fail=1