multiv01.at 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2004 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 2, 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. genfile --length 7168 > 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. tar -c --multi-volume --tape-length=10 \
  32. --listed-incremental=t.snar \
  33. -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
  34. mkdir extract-dir-pipe
  35. dd bs=4096 count=10 if=t2-pipe.tar 2>/dev/null |
  36. PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
  37. -C extract-dir-pipe -x --multi-volume \
  38. --tape-length=10 --read-full-records || exit 1
  39. cmp file1 extract-dir-pipe/file1
  40. cmp file2 extract-dir-pipe/file2
  41. ],
  42. [0],
  43. [],[],[],[],[gnu, oldgnu, pax])
  44. AT_CLEANUP