tests: avoid a race in tail --retry testing
[coreutils.git] / tests / mv / part-hardlink.sh
blobcb8e8d229bca5320d64b6c23f601cc870c5bd3ab
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-2013 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 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
23 print_ver_ mv
24 cleanup_() { rm -rf "$other_partition_tmpdir"; }
25 . "$abs_srcdir/tests/other-fs-tmpdir"
27 touch f || framework_failure_
28 ln f g || framework_failure_
29 mkdir a b || framework_failure_
30 touch a/1 || framework_failure_
31 ln a/1 b/1 || framework_failure_
34 mv f g "$other_partition_tmpdir" || fail=1
35 mv a b "$other_partition_tmpdir" || fail=1
37 cd "$other_partition_tmpdir"
38 set $(ls -Ci f g)
39 test $1 = $3 || fail=1
40 set $(ls -Ci a/1 b/1)
41 test $1 = $3 || fail=1
43 Exit $fail