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