2 # Ensure that hard links are preserved when moving between partitions
3 # and when the links are in separate command line arguments.
4 # For additional constraints, see the comment in copy.c.
5 # Before coreutils-5.2.1, this test would fail.
7 # Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 if test "$VERBOSE" = yes; then
29 . $srcdir/../other-fs-tmpdir
30 . $srcdir/../envvar-check
33 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
34 trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
35 trap '(exit $?); exit' 1 2 13 15
37 if test -z "$other_partition_tmpdir"; then
40 t0="$t0 $other_partition_tmpdir"
43 mkdir -p $tmp || framework_failure=1
44 cd $tmp || framework_failure=1
45 touch f || framework_failure=1
46 ln f g || framework_failure=1
47 mkdir a b || framework_failure=1
48 touch a/1 || framework_failure=1
49 ln a/1 b/1 || framework_failure=1
51 if test $framework_failure = 1; then
52 echo "$0: failure in testing framework" 1>&2
58 mv f g $other_partition_tmpdir || fail=1
59 mv a b $other_partition_tmpdir || fail=1
61 cd $other_partition_tmpdir
63 test $1 = $3 || fail=1
65 test $1 = $3 || fail=1
67 (exit $fail); exit $fail