summaryrefslogtreecommitdiff
path: root/tests/tail-2/symlink.sh
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-03-05 18:41:16 +0000
committerPádraig Brady <P@draigBrady.com>2014-03-05 19:02:20 +0000
commit056d6de78fcf11a0f404f25faf8cecc9f9ee9c1c (patch)
treecd5235d3fd1e8b0142c543541675dd66f26c3d91 /tests/tail-2/symlink.sh
parent5dce6bdfafc930dfd17d5d16aea7d1add3472066 (diff)
downloadcoreutils-056d6de78fcf11a0f404f25faf8cecc9f9ee9c1c.tar.xz
tests: avoid the :> construct which can hide errors
On most shells `:>file || framework_failure_` will not evaluate the framework_failure_ even if there was an error writing the file. shells which do evaluate the failure are ksh 93u+ and bash 4.2, while shells wich don't include bash 4.3, solaris, freebsd, dash. Furthermore this construct is problematic on Solaris 10 sh, which will try to optimize away a `:' command in a loop after the first iteration, even if it is redirected. * tests/cp/link-deref.sh: Remove the leading colon on redirections. * tests/cp/reflink-perm.sh: Likewise. * tests/id/zero.sh: Likewise. * tests/install/install-C.sh: Likewise. * tests/misc/env.sh: Likewise. * tests/misc/md5sum-bsd.sh: Likewise. * tests/misc/runcon-no-reorder.sh: Likewise. * tests/mv/partition-perm.sh: Likewise. * tests/rm/r-root.sh: Likewise. * tests/split/l-chunk.sh: Likewise. * tests/split/line-bytes.sh: Likewise. * tests/tail-2/inotify-rotate.sh: Likewise. * tests/tail-2/retry.sh: Likewise. * tests/tail-2/symlink.sh: Likewise. * tests/tail-2/wait.sh: Likewise. * tests/touch/read-only.sh: Likewise. + cfg.mk (sc_prohibit_colon_redirection): A new syntax check to avoid further instances of this creeping in.
Diffstat (limited to 'tests/tail-2/symlink.sh')
-rwxr-xr-xtests/tail-2/symlink.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/tail-2/symlink.sh b/tests/tail-2/symlink.sh
index 362cb6353..b21f9e15c 100755
--- a/tests/tail-2/symlink.sh
+++ b/tests/tail-2/symlink.sh
@@ -32,7 +32,7 @@ wait4lines_ ()
# Ensure changing targets of cli specified symlinks are handled.
# Prior to v8.22, inotify would fail to recognize changes in the targets.
# Clear 'out' so that we can check its contents without races.
-:>out || framework_failure_
+>out || framework_failure_
ln -nsf target symlink || framework_failure_
timeout 10 tail -s.1 -F symlink >out 2>&1 & pid=$!
retry_delay_ wait4lines_ .1 6 1 || fail=1 # Wait for "cannot open..."
@@ -50,7 +50,7 @@ rm -f target out || framework_failure_
# Ensure we correctly handle the source symlink itself changing.
# I.E. that we don't operate solely on the targets.
# Clear 'out' so that we can check its contents without races.
-:>out || framework_failure_
+>out || framework_failure_
echo "X1" > target1 || framework_failure_
ln -nsf target1 symlink || framework_failure_
timeout 10 tail -s.1 -F symlink >out 2>&1 & pid=$!