sparsemv.at 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2005 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. 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. genfile --sparse --file sparsefile 0 ABCDEFGHIJ 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 -t -M -f arc.1 -f arc.2
  31. echo "Compare archive"
  32. tar -d -M -f arc.1 -f arc.2
  33. echo "Pass 2: Split within a data block"
  34. genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGH || 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 -t -M -f arc.1 -f arc.2
  39. echo "Compare archive"
  40. tar -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