]> Dogcows Code - chaz/tar/blob - tests/listed02.at
Update FSF postal mail address.
[chaz/tar] / tests / listed02.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright (C) 2004 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 2, 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 # 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([listed02])
30
31 AT_TAR_CHECK([
32
33 echo Create directories
34 mkdir tart
35 sleep 1
36 mkdir tart/c0
37 sleep 1
38 mkdir tart/c1
39 sleep 1
40
41 for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
42 do
43 echo File $file > $file
44 sleep 1
45 done
46
47 sleep 1
48 echo Creating main archive
49 tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart || exit 1
50
51 sleep 1
52 echo Modifying filesystem
53 rm tart/a1
54
55 # Current incremental backup algorithm is not able to cope with
56 # renamed files on filesystems that do not change ctime when
57 # renaming. So, if we're on such filesystem, we skip this test.
58 CTIME=`genfile --stat=ctime tart/b1`
59 mv tart/b1 tart/b2
60 if test $CTIME -eq `genfile --stat=ctime tart/b2`; then
61 AT_SKIP_TEST
62 fi
63 #
64 mv tart/c1 tart/c2
65 touch tart/c2/ca3
66
67 echo Directory contents
68 find tart -print | sort 2>/dev/null
69
70 sleep 1
71 echo Creating incremental archive
72 cp -p tart.incr1 tart.incr2
73 tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
74
75 sleep 1
76
77 rm -rf tart/*
78 echo 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/ca1
118 tart/c2/ca2
119 tart/c2/ca3
120 Extracting main archive
121 tart/
122 tart/c0/
123 tart/c1/
124 tart/a1
125 tart/b1
126 tart/c0/cq1
127 tart/c0/cq2
128 tart/c1/ca1
129 tart/c1/ca2
130 Extracting incremental archive
131 tar: Deleting `tart/a1'
132 tar: Deleting `tart/b1'
133 tar: Deleting `tart/c1'
134 tart/
135 tart/b2
136 tart/c0/
137 tart/c2/
138 tart/c2/ca1
139 tart/c2/ca2
140 tart/c2/ca3
141 Final files:
142 tart
143 tart/b2
144 tart/c0
145 tart/c0/cq1
146 tart/c0/cq2
147 tart/c2
148 tart/c2/ca1
149 tart/c2/ca2
150 tart/c2/ca3
151 ],
152 [tar: tart/c0: Directory is new
153 tar: tart/c1: Directory is new
154 tar: tart/c2: Directory is new
155 ],
156 [],[],[gnu, oldgnu])
157
158 AT_CLEANUP
This page took 0.04504 seconds and 5 git commands to generate.