| 1 |
# Process this file with autom4te to create testsuite. -*- Autotest -*- |
| 2 |
# |
| 3 |
# Test suite for GNU tar. |
| 4 |
# Copyright 2016-2023 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 |
# Adding files to an archive with a blocking factor different from the one |
| 22 |
# used when creating it would produce a malformed archive. |
| 23 |
# |
| 24 |
# Last-Affected-Version: 1.28.90 (da7845c6563e7337bf3e8364046a7989091f190e) |
| 25 |
# Reported-by: Initial report by Renate Pyhel <[email protected]>. Explained |
| 26 |
# in detail by Tim Kientzle. This test case is based on his posting. |
| 27 |
# References: <CALyyU7QJRQEQWMqZ=J=ppu-nwOH6R58Ci2ZkV32+CeZKsWsz7Q@mail.gmail.com>, |
| 28 |
# <[email protected]>, |
| 29 |
# http://lists.gnu.org/archive/html/bug-tar/2016-03/msg00002.html, |
| 30 |
# http://lists.gnu.org/archive/html/bug-tar/2016-03/msg00004.html |
| 31 |
|
| 32 |
AT_SETUP([append after changed blocking]) |
| 33 |
AT_KEYWORDS([append append05 blocking]) |
| 34 |
|
| 35 |
AT_TAR_CHECK([ |
| 36 |
for f in a b c d e f g h i |
| 37 |
do |
| 38 |
echo $f > $f |
| 39 |
done |
| 40 |
|
| 41 |
decho 'creating archive' |
| 42 |
tar -cf archive -b1 a b c |
| 43 |
|
| 44 |
tar tf archive |
| 45 |
|
| 46 |
decho 'adding d e f' |
| 47 |
tar -vrf archive -b3 d e f |
| 48 |
echo == |
| 49 |
tar tf archive |
| 50 |
|
| 51 |
decho 'adding g h i' |
| 52 |
tar -vrf archive -b5 g h i |
| 53 |
|
| 54 |
decho 'resulting archive' |
| 55 |
tar tf archive |
| 56 |
], |
| 57 |
[0], |
| 58 |
[creating archive |
| 59 |
a |
| 60 |
b |
| 61 |
c |
| 62 |
adding d e f |
| 63 |
d |
| 64 |
e |
| 65 |
f |
| 66 |
== |
| 67 |
a |
| 68 |
b |
| 69 |
c |
| 70 |
d |
| 71 |
e |
| 72 |
f |
| 73 |
adding g h i |
| 74 |
g |
| 75 |
h |
| 76 |
i |
| 77 |
resulting archive |
| 78 |
a |
| 79 |
b |
| 80 |
c |
| 81 |
d |
| 82 |
e |
| 83 |
f |
| 84 |
g |
| 85 |
h |
| 86 |
i |
| 87 |
], |
| 88 |
[creating archive |
| 89 |
adding d e f |
| 90 |
adding g h i |
| 91 |
resulting archive |
| 92 |
]) |
| 93 |
|
| 94 |
AT_CLEANUP |
| 95 |
|
| 96 |
|