sparsemvp.at 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. # Check if sparse files are correctly split between PAX multi-volume
  16. # archives.
  17. # See comment in sparsemv.at for the description.
  18. dnl TAR_MVP_TEST version map1 map2
  19. m4_define([TAR_MVP_TEST],[
  20. AT_TAR_CHECK([
  21. exec <&-
  22. TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw"
  23. genfile --sparse --file sparsefile $2 || AT_SKIP_TEST
  24. echo "Pass 1: Split between data blocks"
  25. echo "Create archive"
  26. tar --sparse --sparse-version=$1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
  27. echo "Test archive"
  28. tar -t -M -f arc.1 -f arc.2 -f arc.3
  29. echo "Compare archive"
  30. tar -d -M -f arc.1 -f arc.2 -f arc.3
  31. echo "Pass 2: Split within a data block"
  32. genfile --sparse --file sparsefile $3 || AT_SKIP_TEST
  33. echo "Create archive"
  34. tar --sparse --sparse-version=$1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
  35. echo "Test archive"
  36. tar -t -M -f arc.1 -f arc.2 -f arc.3
  37. echo "Compare archive"
  38. tar -d -M -f arc.1 -f arc.2 -f arc.3
  39. ],
  40. [0],
  41. [Pass 1: Split between data blocks
  42. Create archive
  43. Test archive
  44. sparsefile
  45. Compare archive
  46. Pass 2: Split within a data block
  47. Create archive
  48. Test archive
  49. sparsefile
  50. Compare archive
  51. ],
  52. [],[],[],[pax])])