Update copyright years
[tar.git] / tests / multiv10.at
blob8dd1628cd971219aaec42a38c52b80d80320b4ac
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 # Test suite for GNU tar.
3 # Copyright 2015-2022 Free Software Foundation, Inc.
5 # GNU tar is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # GNU tar is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 # Description: When creating multivolume archives, the bufmap code in
19 # buffer.c implicitly assumed that the members are stored in the archive
20 # in a contiguous fashion, ignoring the member (and eventual extended) headers
21 # between them.  This worked until the member header happened to be at
22 # the very beginning of the volume, in which case its length was included in
23 # the calculation of the stored size and size left to store.  Due to this,
24 # the GNUFileParts extended header contained invalid GNU.volume.offset value,
25 # and the resulting archive failed to extract properly.  The bug affected
26 # versions of tar up to 1.29.90 (commit da8d0659a6).
28 # This test case also checks that GNUFileParts headers are not displayed in
29 # verbose mode.
30
31 # Reported by: <russiangolem@gmail.com>
32 # References:
33 #     <CAE7Kiz_0oMqGdzkoh0FbOd=hUoPhtHHYhjZveM_4hEku081QFQ@mail.gmail.com>,
34 #     http://lists.gnu.org/archive/html/bug-tar/2017-05/msg00007.html
37 AT_SETUP([file start at the beginning of a posix volume])
38 AT_KEYWORDS([multivolume multiv multiv10])
40 AT_TAR_CHECK([
41 set -e
42 genfile --length=15360 --file data1
43 genfile --length=15360 --file data2
44 tar -v -c -L 10 -M -f 1.tar -f 2.tar -f 3.tar -f 4.tar -f 5.tar data1 data2
45 tar -M -t -f 1.tar -f 2.tar -f 3.tar -f 4.tar -f 5.tar
46 mkdir out
47 tar -C out -M -x -f 1.tar -f 2.tar -f 3.tar -f 4.tar -f 5.tar
48 cmp data1 out/data1
49 cmp data2 out/data2
51 [0],
52 [data1
53 data2
54 data1
55 data2
57 [],[],[],[posix])
59 AT_CLEANUP