1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright 2010, 2013 Free Software Foundation, Inc.
6 # This file is part of GNU tar.
8 # GNU tar is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # GNU tar is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # Tar up to 1.26 was unable to cope with directories that had once
22 # been part of the dumped system and became separate mount points
23 # afterwards. The bug has been reported by Nathan Stratton Treadway,
24 # who also proposed a fix and a testcase, on which the present one is
26 # Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
27 # Last-Affected-Version: 1.26
28 # References: <20120527212417.GR2654@shire.ontko.com>
29 # http://lists.gnu.org/archive/html/bug-tar/2012-05/msg00022.html
31 # This testcase is Linux-specific and requires root privileges.
33 AT_SETUP([--listed-incremental and remounted directories])
34 AT_KEYWORDS([listed incremental listed05])
38 options="-C tartest --create --one-file-system --verbose"
39 rm -rf archive-[01].snar archive-[01].tar tartest subdir
41 # Create initial structure
43 echo "hi" > tartest/top-level-file
45 echo "hi" > tartest/subdir/subdir-file
48 tar $options --file archive-0.tar --listed-incremental=archive-0.snar .
53 mount -t ramfs none tartest/subdir || AT_SKIP_TEST
54 tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
57 cp archive-0.snar archive-1.snar
58 tar $options --file archive-1.tar --listed-incremental=archive-1.snar .
73 [tar: .: Directory is new
74 tar: ./subdir: Directory is new
75 tar: ./subdir: directory is on a different filesystem; not dumped