sparsemv.at 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2005-2008, 2013 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. AT_SETUP([sparse files in MV archives])
  16. AT_KEYWORDS([sparse multiv sparsemv])
  17. # Check if sparse files are correctly split between GNU multi-volume
  18. # archives.
  19. # There are two cases: the file can be split within an empty (null) block,
  20. # or within a data block. Since null blocks are not archived, the first
  21. # case means the file is split between two consecutive data blocks.
  22. #
  23. AT_TAR_CHECK([
  24. exec <&-
  25. genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || AT_SKIP_TEST
  26. echo "Pass 1: Split between data blocks"
  27. echo "Create archive"
  28. tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
  29. echo "Test archive"
  30. tar --record-size=512 -t -M -f arc.1 -f arc.2
  31. echo "Compare archive"
  32. tar --record-size=512 -d -M -f arc.1 -f arc.2
  33. echo "Pass 2: Split within a data block"
  34. genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || AT_SKIP_TEST
  35. echo "Create archive"
  36. tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
  37. echo "Test archive"
  38. tar --record-size=512 -t -M -f arc.1 -f arc.2
  39. echo "Compare archive"
  40. tar --record-size=512 -d -M -f arc.1 -f arc.2
  41. ],
  42. [0],
  43. [Pass 1: Split between data blocks
  44. Create archive
  45. Test archive
  46. sparsefile
  47. Compare archive
  48. Pass 2: Split within a data block
  49. Create archive
  50. Test archive
  51. sparsefile
  52. Compare archive
  53. ],
  54. [],[],[],[gnu, oldgnu])
  55. AT_CLEANUP