multiv01.at 2.0 KB

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