summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2023-02-26 18:10:41 +0000
committerPádraig Brady <P@draigBrady.com>2023-02-26 18:31:35 +0000
commit995021cb0ce72ea9c235bbf71c69d3b96bfa84e9 (patch)
tree4c8addc7c1a5f83fcc4db405bf409c1434449958 /tests
parent3ead67dd163977fb03932e67485a4a27d498185d (diff)
downloadcoreutils-995021cb0ce72ea9c235bbf71c69d3b96bfa84e9.tar.gz
tests: avoid hang in new test
* tests/rm/empty-inacc.sh: Ensure we're not reading from stdin when we're relying on no prompt to proceed. Also change the file being tested so that a failure in one test doesn't impact following tests causing a framework failure.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rm/empty-inacc.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/rm/empty-inacc.sh b/tests/rm/empty-inacc.sh
index 807ff4d1d..56f7ef345 100755
--- a/tests/rm/empty-inacc.sh
+++ b/tests/rm/empty-inacc.sh
@@ -39,23 +39,23 @@ mkdir -m a-r unreadable2 || framework_failure_
mkdir -m0 inacc2 || framework_failure_
# These would fail for coreutils-9.1 and prior.
-rm -d unreadable2 || fail=1
+rm -d unreadable2 < /dev/null || fail=1
test -d unreadable2 && fail=1
-rm -d inacc2 || fail=1
+rm -d inacc2 < /dev/null || fail=1
test -d inacc2 && fail=1
# Test the interactive code paths that are new with 9.2:
-mkdir -m0 inacc2 || framework_failure_
+mkdir -m0 inacc3 || framework_failure_
-echo n | rm ---presume-input-tty -di inacc2 > out 2>&1 || fail=1
+echo n | rm ---presume-input-tty -di inacc3 > out 2>&1 || fail=1
# decline: ensure it was not deleted, and the prompt was as expected.
-printf "rm: attempt removal of inaccessible directory 'inacc2'? " > exp
-test -d inacc2 || fail=1
+printf "rm: attempt removal of inaccessible directory 'inacc3'? " > exp
+test -d inacc3 || fail=1
compare exp out || fail=1
-echo y | rm ---presume-input-tty -di inacc2 > out 2>&1 || fail=1
+echo y | rm ---presume-input-tty -di inacc3 > out 2>&1 || fail=1
# accept: ensure it **was** deleted, and the prompt was as expected.
-test -d inacc2 && fail=1
+test -d inacc3 && fail=1
compare exp out || fail=1
Exit $fail