sparsemv.at 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2005-2023 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. TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw"
  26. genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || AT_SKIP_TEST
  27. echo "Pass 1: Split between data blocks"
  28. echo "Create archive"
  29. tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
  30. echo "Test archive"
  31. tar --record-size=512 -t -M -f arc.1 -f arc.2
  32. echo "Compare archive"
  33. tar --record-size=512 -d -M -f arc.1 -f arc.2
  34. echo "Pass 2: Split within a data block"
  35. genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || AT_SKIP_TEST
  36. echo "Create archive"
  37. tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1
  38. echo "Test archive"
  39. tar --record-size=512 -t -M -f arc.1 -f arc.2
  40. echo "Compare archive"
  41. tar --record-size=512 -d -M -f arc.1 -f arc.2
  42. ],
  43. [0],
  44. [Pass 1: Split between data blocks
  45. Create archive
  46. Test archive
  47. sparsefile
  48. Compare archive
  49. Pass 2: Split within a data block
  50. Create archive
  51. Test archive
  52. sparsefile
  53. Compare archive
  54. ],
  55. [],[],[],[gnu, oldgnu])
  56. AT_CLEANUP