]> Dogcows Code - chaz/tar/blob - tests/listed05.at
Update copyright years.
[chaz/tar] / tests / listed05.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 #
3 # Test suite for GNU tar.
4 # Copyright 2010, 2013-2014 Free Software Foundation, Inc.
5
6 # This file is part of GNU tar.
7
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.
12
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.
17
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/>.
20
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
30
31 # This testcase is Linux-specific and requires root privileges.
32
33 AT_SETUP([--listed-incremental and remounted directories])
34 AT_KEYWORDS([listed incremental listed05])
35
36 AT_TAR_CHECK([
37 AT_PRIVILEGED_PREREQ
38 options="-C tartest --create --one-file-system --verbose"
39 rm -rf archive-[01].snar archive-[01].tar tartest subdir
40
41 # Create initial structure
42 mkdir tartest
43 echo "hi" > tartest/top-level-file
44 mkdir tartest/subdir
45 echo "hi" > tartest/subdir/subdir-file
46
47 echo "# Level 0"
48 tar $options --file archive-0.tar --listed-incremental=archive-0.snar .
49
50 echo "# Remount"
51 mv tartest/subdir .
52 mkdir tartest/subdir
53 mount -t ramfs none tartest/subdir || AT_SKIP_TEST
54 tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
55
56 echo "# Level 1"
57 cp archive-0.snar archive-1.snar
58 tar $options --file archive-1.tar --listed-incremental=archive-1.snar .
59
60 umount tartest/subdir
61 ],
62 [0],
63 [# Level 0
64 ./
65 ./subdir/
66 ./top-level-file
67 ./subdir/subdir-file
68 # Remount
69 # Level 1
70 ./
71 ./subdir/
72 ],
73 [tar: .: Directory is new
74 tar: ./subdir: Directory is new
75 tar: ./subdir: directory is on a different filesystem; not dumped
76 ],[],[],[gnu])
77
78 AT_CLEANUP
This page took 0.033498 seconds and 4 git commands to generate.