]> git.cworth.org Git - tar/blob - tests/chtype.at
upstream: Fix extraction of device nodes.
[tar] / tests / chtype.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright (C) 2006, 2007 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, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21 # Description: Incremental restore malfunctions if an archive member
22 # changes type before restoration, e.g. from directory to file or vice
23 # versa.
24 # Reported by: Wolfram Kleff <bugreport@wkleff.intergenia.de>
25 # References: <200605101232.25031.bugreport@wkleff.intergenia.de>
26
27 AT_SETUP([changed file types in incrementals])
28 AT_KEYWORDS([incremental chtype])
29
30 AT_TAR_CHECK([
31 AT_SORT_PREREQ
32 AT_TAR_MKHIER([directory/b/c],[x])
33 mkdir directory/a
34 genfile --file directory/a/a
35
36 echo First backup
37 tar --create --file=archive.1 --listed-incremental=db.1 directory
38
39 sleep 2
40
41 # Remove directory b and create a file with this name.
42 # Previous versions were not able to restore over this file.
43 rm -r directory/b
44 genfile --file directory/b
45 genfile --file directory/a/b
46
47 echo Second backup
48 tar --create --file=archive.2 --listed-incremental=db.2 directory
49
50 # Delete a
51 rm -r directory
52
53 echo Restore archive.1
54 tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
55 echo Restore archive.2
56 tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
57 find directory | sort
58 ],
59 [0],
60 [First backup
61 Second backup
62 Restore archive.1
63 Restore archive.2
64 directory
65 directory/a
66 directory/a/a
67 directory/a/b
68 directory/b
69 ],[],[],[],[gnu, oldgnu, posix])
70
71 AT_CLEANUP
72
73 # End of chtype.at