sparse03.at 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2005-2007, 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([storing sparse files > 8G])
  17. AT_KEYWORDS([sparse sparse03 largefile])
  18. # Tar 1.15.1 incorrectly computed sparse member size if the extended
  19. # PAX header contained size keyword.
  20. # References: <[email protected]>
  21. # http://lists.gnu.org/archive/html/bug-tar/2005-06/msg00040.html
  22. AT_TAR_CHECK([
  23. AT_SKIP_LARGE_FILES
  24. genfile --length 1000 --file begin
  25. genfile --length 1000 --file end
  26. genfile --sparse --file sparsefile --block-size 512 8G A || AT_SKIP_TEST
  27. tar -c -f archive --sparse begin sparsefile end || exit 1
  28. echo separator
  29. tar tfv archive
  30. echo separator
  31. mkdir directory
  32. tar Cxf directory archive
  33. genfile --stat=name,size sparsefile
  34. cmp sparsefile directory/sparsefile
  35. ],
  36. [0],
  37. [stdout],
  38. [],[],[],[posix])
  39. RE_CHECK([stdout],
  40. [separator
  41. -rw-r--r-- [^ ][^ ]* *1000 [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] begin
  42. -rw-r--r-- [^ ][^ ]* *8589935104 [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] sparsefile
  43. -rw-r--r-- [^ ][^ ]* *1000 [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] end
  44. separator
  45. sparsefile 8589935104
  46. ])
  47. AT_CLEANUP