summaryrefslogtreecommitdiff
path: root/tests/ln/hard-to-sym.sh
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-10-31 02:25:02 +0000
committerPádraig Brady <P@draigBrady.com>2015-05-28 02:05:43 +0100
commit1aa71d96332ec210a8c954cc924d43655f2b369f (patch)
treec06e7b97dc9ad4d09c7431015f717cea7fe8fd2d /tests/ln/hard-to-sym.sh
parent67db18ce0ffc516eb0f39bf8ff3d8151ae810fc9 (diff)
downloadcoreutils-1aa71d96332ec210a8c954cc924d43655f2b369f.tar.xz
tests: ln/hard-to-sym FAIL rather than ERROR when ln fails
* tests/ln/hard-to-sym.sh: Only call framework_failure_ when ln returns success.
Diffstat (limited to 'tests/ln/hard-to-sym.sh')
-rwxr-xr-xtests/ln/hard-to-sym.sh36
1 files changed, 21 insertions, 15 deletions
diff --git a/tests/ln/hard-to-sym.sh b/tests/ln/hard-to-sym.sh
index 1e507f4ef..edcee6600 100755
--- a/tests/ln/hard-to-sym.sh
+++ b/tests/ln/hard-to-sym.sh
@@ -29,24 +29,30 @@ ln -s -L -P symlink2 symlink3 || fail=1
# ===================================================
# ensure that -L follows symlinks, and overrides -P
-ln -P -L symlink3 hard-to-a || fail=1
-ls=$(ls -lG hard-to-a)x
-case "$ls" in
- *'hard-to-ax') ;;
- *'hard-to-a -> '*x) fail=1 ;;
- *) framework_failure_ ;;
-esac
+if ln -P -L symlink3 hard-to-a; then
+ ls=$(ls -lG hard-to-a)x
+ case "$ls" in
+ *'hard-to-ax') ;;
+ *'hard-to-a -> '*x) fail=1 ;;
+ *) framework_failure_ ;;
+ esac
+else
+ fail=1
+fi
# ===================================================
# ensure that -P links (or at least duplicates) symlinks, and overrides -L
-ln -L -P symlink3 hard-to-3 || fail=1
-ls=$(ls -lG hard-to-3)x
-case "$ls" in
- *'hard-to-3 -> symlink2x') ;;
- *'hard-to-3x') fail=1 ;;
- *'hard-to-3 -> '*x) fail=1 ;;
- *) framework_failure_ ;;
-esac
+if ln -L -P symlink3 hard-to-3; then
+ ls=$(ls -lG hard-to-3)x
+ case "$ls" in
+ *'hard-to-3 -> symlink2x') ;;
+ *'hard-to-3x') fail=1 ;;
+ *'hard-to-3 -> '*x) fail=1 ;;
+ *) framework_failure_ ;;
+ esac
+else
+ fail=1
+fi
# ===================================================
# Create a hard link to a dangling symlink.