sparsemv.at 2.2 KB

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