multiv01.at 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2004-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  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.
  9. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Test multivolume dumps from pipes.
  16. AT_SETUP([multivolume dumps from pipes])
  17. AT_KEYWORDS([multivolume multiv multiv01 chdir])
  18. # Fixme: should be configurable
  19. # TRUSS=truss -o /tmp/tr
  20. # TRUSS=strace
  21. AT_TAR_CHECK([
  22. exec <&-
  23. genfile --length 7168 --file file1
  24. for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
  25. " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
  26. echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  27. for count in 2 3 4 5 6 7 8 ; do
  28. echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
  29. done
  30. done >file2
  31. if test $TEST_TAR_FORMAT = pax; then
  32. TAPE_LENGTH=11
  33. else
  34. TAPE_LENGTH=10
  35. fi
  36. tar -c --multi-volume --tape-length=$TAPE_LENGTH \
  37. -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
  38. mkdir extract-dir-pipe
  39. dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
  40. PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
  41. -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \
  42. --tape-length=$TAPE_LENGTH --read-full-records || exit 1
  43. cmp file1 extract-dir-pipe/file1
  44. cmp file2 extract-dir-pipe/file2
  45. ],
  46. [0],
  47. [],[],[],[],[gnu, oldgnu, pax])
  48. AT_CLEANUP