build: prepare to enable -Werror also for gnulib-tests/
[coreutils/ericb.git] / tests / mv / part-hardlink
blob5b372d421c82388298d5b21ec442e7d9ded61103
1 #!/bin/sh
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-2010 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 3 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, see <http://www.gnu.org/licenses/>.
22 if test "$VERBOSE" = yes; then
23 set -x
24 mv --version
27 . $srcdir/test-lib.sh
28 cleanup_() { rm -rf "$other_partition_tmpdir"; }
29 . "$abs_srcdir/other-fs-tmpdir"
31 touch f || framework_failure
32 ln f g || framework_failure
33 mkdir a b || framework_failure
34 touch a/1 || framework_failure
35 ln a/1 b/1 || framework_failure
38 mv f g "$other_partition_tmpdir" || fail=1
39 mv a b "$other_partition_tmpdir" || fail=1
41 cd "$other_partition_tmpdir"
42 set `ls -Ci f g`
43 test $1 = $3 || fail=1
44 set `ls -Ci a/1 b/1`
45 test $1 = $3 || fail=1
47 Exit $fail