sparse01.at 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2004-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])
  16. AT_KEYWORDS([sparse sparse01])
  17. AT_TAR_CHECK([
  18. genfile --length 1000 -f begin
  19. genfile --length 1000 -f end
  20. genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || AT_SKIP_TEST
  21. tar -c -f archive --sparse begin sparsefile end || exit 1
  22. echo separator
  23. tar tfv archive
  24. echo separator
  25. mkdir directory
  26. tar Cxf directory archive --warning=no-timestamp
  27. genfile --stat=name,size sparsefile
  28. cmp sparsefile directory/sparsefile
  29. ],
  30. [0],
  31. [stdout],
  32. [],[],[],[posix, gnu, oldgnu])
  33. RE_CHECK([stdout],
  34. [separator
  35. -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
  36. -rw-r--r-- [^ ][^ ]* *10344448 [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
  37. -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
  38. separator
  39. sparsefile 10344448
  40. ])
  41. AT_CLEANUP