summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2010-11-09 12:43:20 +0000
committerPádraig Brady <P@draigBrady.com>2010-11-09 12:43:20 +0000
commit425503c8073a17df5ace9bb9330ce283804b07e1 (patch)
tree6f2f60c34b53a5886909c533f1c455b4fe11d312 /tests
parent4a14a80bd1a88dde4e361aa259264a54c4ffa3ea (diff)
downloadcoreutils-425503c8073a17df5ace9bb9330ce283804b07e1.tar.xz
tests: avoid portability problem with dash vs. symlinked ttys
* tests/mv/i-3: Adjust so that the symlink is resolved before redirecting to the background command, as otherwise the stdin descriptor passed to the command will fail the isatty() or ttyname() test.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/mv/i-38
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/mv/i-3 b/tests/mv/i-3
index 78a252664..7247d9432 100755
--- a/tests/mv/i-3
+++ b/tests/mv/i-3
@@ -34,10 +34,14 @@ chmod 0 g i || framework_failure
ls /dev/stdin >/dev/null 2>&1 \
|| skip_test_ 'there is no /dev/stdin file'
-test -r /dev/stdin 2>&1 \
+# work around a dash bug when redirecting
+# from symlinked ttys in the background
+tty=$(readlink -f /dev/stdin)
+
+test -r "$tty" 2>&1 \
|| skip_test_ '/dev/stdin is not readable'
-mv f g < /dev/stdin > out 2>&1 & pid=$!
+mv f g < $tty > out 2>&1 & pid=$!
# Wait up to 3.1s for the expected prompt
check_overwrite_prompt()