Use stdopen from gnulib
[tar.git] / tests / listed05.at
blob988246d0ef0380c1f66e7ad23da554190e3b6e8e
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright 2010-2021 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
25 # built.
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 chdir])
36 AT_TAR_CHECK([
37 AT_CHECK_TIMESTAMP
38 AT_PRIVILEGED_PREREQ
39 options="-C tartest --create --one-file-system --verbose"
40 rm -rf archive-[01].snar archive-[01].tar tartest subdir
42 # Create initial structure
43 mkdir tartest
44 echo "hi" > tartest/top-level-file
45 mkdir tartest/subdir
46 echo "hi" > tartest/subdir/subdir-file
48 echo "# Level 0"
49 tar $options --file archive-0.tar --listed-incremental=archive-0.snar .
51 echo "# Remount"
52 mv tartest/subdir .
53 mkdir tartest/subdir
54 mount -t ramfs none tartest/subdir || AT_SKIP_TEST
55 tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
57 echo "# Level 1"
58 cp archive-0.snar archive-1.snar
59 tar $options --file archive-1.tar --listed-incremental=archive-1.snar .
61 umount tartest/subdir
63 [0],
64 [# Level 0
66 ./subdir/
67 ./top-level-file
68 ./subdir/subdir-file
69 # Remount
70 # Level 1
72 ./subdir/
74 [tar: .: Directory is new
75 tar: ./subdir: Directory is new
76 tar: ./subdir: directory is on a different filesystem; not dumped
77 ],[],[],[gnu])
79 AT_CLEANUP