summaryrefslogtreecommitdiff
path: root/tests/mv/atomic
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mv/atomic')
-rwxr-xr-xtests/mv/atomic19
1 files changed, 3 insertions, 16 deletions
diff --git a/tests/mv/atomic b/tests/mv/atomic
index cf4dea40f..ef30398e7 100755
--- a/tests/mv/atomic
+++ b/tests/mv/atomic
@@ -22,15 +22,7 @@ if test "$VERBOSE" = yes; then
fi
. $srcdir/../strace
-
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
+. $srcdir/../test-lib.sh
# Before the fix, mv would unnecessarily unlink the destination symlink:
# $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2; strace -qe unlink /bin/mv -T s1 s2
@@ -40,13 +32,8 @@ cd $tmp || framework_failure=1
# $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2; strace -qe unlink ./mv -T s1 s2
# $
-ln -s t1 s1 || framework_failure=1
-ln -s t2 s2 || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+ln -s t1 s1 || framework_failure
+ln -s t2 s2 || framework_failure
fail=0