]> Dogcows Code - chaz/tar/blob - tests/listed02.at
Update copyright years.
[chaz/tar] / tests / listed02.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright 2004-2007, 2009, 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 # Check if listed-incremental backups work for files moved from one directory
22 # to another.
23 # Based on a script by Martin Simmons <ZYHYLCRMZPRP@spammotel.com>
24 # References:
25 # <20040626230315.163AA1D148@cpc5-cmbg1-6-0-cust208.cmbg.cable.ntl.com>
26 # http://lists.gnu.org/archive/html/bug-tar/2004-06/msg00028.html
27
28 AT_SETUP([working --listed])
29 AT_KEYWORDS([listed incremental listed02])
30
31 AT_TAR_CHECK([
32 AT_SORT_PREREQ
33 echo Create directories
34
35 mkdir tart
36 sleep 1
37 mkdir tart/c0
38 sleep 1
39 mkdir tart/c1
40 sleep 1
41
42 for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
43 do
44 echo File $file > $file
45 sleep 1
46 done
47
48 sleep 1
49 echo Creating main archive
50 echo >&2 "Creating main archive"
51 tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
52
53 # The above prints two lines to stderr announcing the new directories c0 and c1.
54 # Ensure that they appear in this script's stderr in sorted order.
55 sort err 1>&2; rm -f err
56
57 sleep 1
58 echo Modifying filesystem
59 rm tart/a1
60
61 mv tart/b1 tart/b2
62 mv tart/c1 tart/c2
63 touch tart/c2/ca3
64
65 echo Directory contents
66 find tart -print | sort 2>/dev/null
67
68 sleep 1
69 echo Creating incremental archive
70 echo >&2 "Creating incremental archive"
71 cp -p tart.incr1 tart.incr2
72 tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
73
74 sleep 1
75
76 rm -rf tart/*
77 echo Extracting main archive
78 echo >&2 "Extracting main archive"
79 tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
80 echo Extracting incremental archive
81 # This command should produce three messages about deletion
82 # of the existing files, that may appear in any order. Piping
83 # to sort makes sure we don't depend on any particular ordering.
84 tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
85
86 echo Final files:
87 find tart -print | sort 2>/dev/null
88 ],
89 [0],
90 [Create directories
91 Creating main archive
92 tart/
93 tart/c0/
94 tart/c1/
95 tart/a1
96 tart/b1
97 tart/c0/cq1
98 tart/c0/cq2
99 tart/c1/ca1
100 tart/c1/ca2
101 Modifying filesystem
102 Directory contents
103 tart
104 tart/b2
105 tart/c0
106 tart/c0/cq1
107 tart/c0/cq2
108 tart/c2
109 tart/c2/ca1
110 tart/c2/ca2
111 tart/c2/ca3
112 Creating incremental archive
113 tart/
114 tart/c0/
115 tart/c2/
116 tart/b2
117 tart/c2/ca3
118 Extracting main archive
119 tart/
120 tart/c0/
121 tart/c1/
122 tart/a1
123 tart/b1
124 tart/c0/cq1
125 tart/c0/cq2
126 tart/c1/ca1
127 tart/c1/ca2
128 Extracting incremental archive
129 tar: Deleting 'tart/a1'
130 tar: Deleting 'tart/b1'
131 tart/
132 tart/b2
133 tart/c0/
134 tart/c2/
135 tart/c2/ca3
136 Final files:
137 tart
138 tart/b2
139 tart/c0
140 tart/c0/cq1
141 tart/c0/cq2
142 tart/c2
143 tart/c2/ca1
144 tart/c2/ca2
145 tart/c2/ca3
146 ],
147 [Creating main archive
148 tar: tart/c0: Directory is new
149 tar: tart/c1: Directory is new
150 tar: tart: Directory is new
151 Creating incremental archive
152 tar: tart/c2: Directory has been renamed from 'tart/c1'
153 Extracting main archive
154 ],
155 [],[],[gnu, oldgnu])
156
157 AT_CLEANUP
This page took 0.036427 seconds and 4 git commands to generate.