sparse03.at 1.9 KB

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