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