]> Dogcows Code - chaz/tar/blob - tests/listed05.at
Fix creation of incremental archives when a subdirectory becomes a mountpoint.
[chaz/tar] / tests / listed05.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 #
3 # Test suite for GNU tar.
4 # Copyright (C) 2010 Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 # Tar up to 1.26 was unable to cope with directories that had once
20 # been part of the dumped system and became separate mount points
21 # afterwards. The bug has been reported by Nathan Stratton Treadway,
22 # who also proposed a fix and a testcase, on which the present one is
23 # built.
24 # Reported-by: Nathan Stratton Treadway <nathanst+bugtar@ontko.com>
25 # Last-Affected-Version: 1.26
26 # References: <20120527212417.GR2654@shire.ontko.com>
27 # http://lists.gnu.org/archive/html/bug-tar/2012-05/msg00022.html
28
29 # This testcase is Linux-specific and requires root privileges.
30
31 AT_SETUP([--listed-incremental and remounted directories])
32 AT_KEYWORDS([listed incremental listed05])
33
34 AT_TAR_CHECK([
35 AT_PRIVILEGED_PREREQ
36 options="-C tartest --create --one-file-system --verbose"
37 rm -rf archive-[01].snar archive-[01].tar tartest subdir
38
39 # Create initial structure
40 mkdir tartest
41 echo "hi" > tartest/top-level-file
42 mkdir tartest/subdir
43 echo "hi" > tartest/subdir/subdir-file
44
45 echo "# Level 0"
46 tar $options --file archive-0.tar --listed-incremental=archive-0.snar .
47
48 echo "# Remount"
49 mv tartest/subdir .
50 mkdir tartest/subdir
51 mount -t ramfs none tartest/subdir || AT_SKIP_TEST
52 tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
53
54 echo "# Level 1"
55 cp archive-0.snar archive-1.snar
56 tar $options --file archive-1.tar --listed-incremental=archive-1.snar .
57
58 umount tartest/subdir
59 ],
60 [0],
61 [# Level 0
62 ./
63 ./subdir/
64 ./top-level-file
65 ./subdir/subdir-file
66 # Remount
67 # Level 1
68 ./
69 ./subdir/
70 ],
71 [tar: .: Directory is new
72 tar: ./subdir: Directory is new
73 tar: ./subdir: directory is on a different filesystem; not dumped
74 ],[],[],[gnu])
75
76 AT_CLEANUP
This page took 0.033257 seconds and 5 git commands to generate.