mirror of
https://github.com/coreutils/coreutils.git
synced 2024-12-12 03:15:15 +08:00
tests: fix removed-directory test
The previous attempt to skip that test on NFS (commit 4181fc5183
)
made the test fail; it introduced two problems:
a) In the good case, i.e., when the subshell returns with exit status 0,
the test ran into framework_failure_.
b) As the subshell also runs with 'set -x', the later comparison of
/dev/null with 'err' would fail.
* tests/ls/removed-directory.sh: Revert to the style without subshell,
and add 'test -d .' to verify that 'ls' can read the removed dir.
This commit is contained in:
parent
6d0107a37f
commit
9dbaf54eed
@ -21,17 +21,16 @@
|
|||||||
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
||||||
print_ver_ ls
|
print_ver_ ls
|
||||||
|
|
||||||
|
cwd=$(pwd)
|
||||||
mkdir d || framework_failure_
|
mkdir d || framework_failure_
|
||||||
(cd d || exit 10
|
cd d || framework_failure_
|
||||||
rmdir ../d || exit 11
|
rmdir ../d || skip_ "can't remove working directory on this platform"
|
||||||
test -d . || exit 12
|
|
||||||
ls || exit 13) >out 2>err
|
# On NFS, 'ls' would run into the error "Stale file handle".
|
||||||
case $? in
|
test -d . || skip_ "can't examine removed working directory on this platform"
|
||||||
11) skip_ "can't remove working directory on this platform";;
|
|
||||||
12) skip_ "can't examine removed working directory on this platform";;
|
ls >../out 2>../err || fail=1
|
||||||
13) fail=1;;
|
cd "$cwd" || framework_failure_
|
||||||
* ) framework_failure_;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
compare /dev/null out || fail=1
|
compare /dev/null out || fail=1
|
||||||
compare /dev/null err || fail=1
|
compare /dev/null err || fail=1
|
||||||
|
Loading…
Reference in New Issue
Block a user