1# Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3# Test suite for GNU tar.
4# Copyright 2006-2021 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# Up to version 1.15.91 tar was unable to recognize all volumes
22# given after an out-of-sync volume.
23# Reported by: Joerg Weilbier <gnu@weilbier.net>
24# References: <200610011952.29880.gnu@weilbier.net>
25
26AT_SETUP([Restoring after an out of sync volume])
27AT_KEYWORDS([multivolume multiv multiv05 sync])
28m4_pushdef([FILELIST],[jeden,dwa,trzy,cztery,piec,szesc])
29
30AT_TAR_CHECK([
31exec <&-
32
33m4_foreach([f],
34  [FILELIST],
35  [genfile --length 250k --file f
36])
37
38echo Creating archive
39tar -c -M -L 502 -f a.tar -f b.tar -f c.tar m4_foreach([f],[FILELIST],f )
40echo separator
41mkdir bak
42mv m4_foreach([f],[FILELIST],f )bak
43tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar
44m4_foreach([f],
45  [FILELIST],
46  [echo Diffing f
47   cmp bak/f f || exit 1
48])],
49[0],
50[Creating archive
51separator]
52m4_foreach([file],
53  [FILELIST],
54  [file
55])dnl
56m4_foreach([file],
57  [FILELIST],
58  [Diffing file
59])dnl
60,
61[tar: 'trzy' is not continued on this volume
62],[],[], [gnu])
63
64m4_popdef([FILELIST])
65AT_CLEANUP
66