| 1 |
# Process this file with autom4te to create testsuite. -*- Autotest -*- |
| 2 |
|
| 3 |
# Test suite for GNU tar. |
| 4 |
# Copyright 2004-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 |
# Test multivolume dumps from pipes. |
| 22 |
|
| 23 |
AT_SETUP([multivolume dumps from pipes]) |
| 24 |
AT_KEYWORDS([multivolume multiv multiv01 chdir]) |
| 25 |
|
| 26 |
# Fixme: should be configurable |
| 27 |
# TRUSS=truss -o /tmp/tr |
| 28 |
# TRUSS=strace |
| 29 |
|
| 30 |
AT_TAR_CHECK([ |
| 31 |
exec <&- |
| 32 |
genfile --length 7168 --file file1 |
| 33 |
|
| 34 |
for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ |
| 35 |
" 9" "10" "11" "12" "13" "14" "15" "16" ; do \ |
| 36 |
echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" |
| 37 |
for count in 2 3 4 5 6 7 8 ; do |
| 38 |
echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" |
| 39 |
done |
| 40 |
done >file2 |
| 41 |
|
| 42 |
if test $TEST_TAR_FORMAT = pax; then |
| 43 |
TAPE_LENGTH=11 |
| 44 |
else |
| 45 |
TAPE_LENGTH=10 |
| 46 |
fi |
| 47 |
|
| 48 |
tar -c --multi-volume --tape-length=$TAPE_LENGTH \ |
| 49 |
-f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 |
| 50 |
|
| 51 |
mkdir extract-dir-pipe |
| 52 |
dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | |
| 53 |
PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ |
| 54 |
-C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ |
| 55 |
--tape-length=$TAPE_LENGTH --read-full-records || exit 1 |
| 56 |
|
| 57 |
cmp file1 extract-dir-pipe/file1 |
| 58 |
cmp file2 extract-dir-pipe/file2 |
| 59 |
], |
| 60 |
[0], |
| 61 |
[],[],[],[],[gnu, oldgnu, pax]) |
| 62 |
|
| 63 |
AT_CLEANUP |