multiv01.at 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. # 02110-1301, USA.
  16. # Test multivolume dumps from pipes.
  17. AT_SETUP([multivolume dumps from pipes])
  18. AT_KEYWORDS([multivolume multiv multiv01])
  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. --listed-incremental=t.snar \
  39. -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
  40. mkdir extract-dir-pipe
  41. dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
  42. PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
  43. -C extract-dir-pipe -x --multi-volume \
  44. --tape-length=$TAPE_LENGTH --read-full-records || exit 1
  45. cmp file1 extract-dir-pipe/file1
  46. cmp file2 extract-dir-pipe/file2
  47. ],
  48. [0],
  49. [],[],[],[],[gnu, oldgnu, pax])
  50. AT_CLEANUP