]> Dogcows Code - chaz/tar/blob - tests/listed02.at
Rewritten testsuite in autotest
[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., 59 Temple Place - Suite 330, Boston, MA
19 # 02111-1307, 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 mkdir directory
33
34 echo Create directories
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 tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart || exit 1
51
52 sleep 1
53 echo Modifying filesystem
54 rm tart/a1
55 mv tart/b1 tart/b2
56 mv tart/c1 tart/c2
57 touch tart/c2/ca3
58
59 echo Directory contents
60 find tart|sort
61
62 sleep 1
63 echo Creating incremental archive
64 cp -p tart.incr1 tart.incr2
65 tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
66
67 sleep 1
68
69 rm -rf tart/*
70 echo Extracting main archive
71 tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
72 echo Extracting incremental archive
73 # This command should produce three messages about deletion
74 # of the existing files, that may appear in any order. Piping
75 # to sort makes sure we don't depend on any particular ordering.
76 tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort
77
78 echo Final files:
79 find tart|sort
80 ],
81 [0],
82 [Create directories
83 Creating main archive
84 tart/
85 tart/c0/
86 tart/c1/
87 tart/a1
88 tart/b1
89 tart/c0/cq1
90 tart/c0/cq2
91 tart/c1/ca1
92 tart/c1/ca2
93 Modifying filesystem
94 Directory contents
95 tart
96 tart/b2
97 tart/c0
98 tart/c0/cq1
99 tart/c0/cq2
100 tart/c2
101 tart/c2/ca1
102 tart/c2/ca2
103 tart/c2/ca3
104 Creating incremental archive
105 tart/
106 tart/c0/
107 tart/c2/
108 tart/b2
109 tart/c2/ca1
110 tart/c2/ca2
111 tart/c2/ca3
112 Extracting main archive
113 tart/
114 tart/c0/
115 tart/c1/
116 tart/a1
117 tart/b1
118 tart/c0/cq1
119 tart/c0/cq2
120 tart/c1/ca1
121 tart/c1/ca2
122 Extracting incremental archive
123 tar: Deleting `tart/a1'
124 tar: Deleting `tart/b1'
125 tar: Deleting `tart/c1'
126 tart/
127 tart/b2
128 tart/c0/
129 tart/c2/
130 tart/c2/ca1
131 tart/c2/ca2
132 tart/c2/ca3
133 Final files:
134 tart
135 tart/b2
136 tart/c0
137 tart/c0/cq1
138 tart/c0/cq2
139 tart/c2
140 tart/c2/ca1
141 tart/c2/ca2
142 tart/c2/ca3
143 ],
144 [tar: tart/c0: Directory is new
145 tar: tart/c1: Directory is new
146 tar: tart/c2: Directory is new
147 ],
148 [],[],[gnu, oldgnu])
149
150 AT_CLEANUP
This page took 0.042081 seconds and 5 git commands to generate.