incr04.at 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-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. # Description: Rewritten incremental backup support (2006-05-08)
  16. # missed initialization of all struct directory members in make_directory,
  17. # which lead to random core dumps.
  18. # Reported by Sergey Myasnikov <[email protected]>. This testcase uses original
  19. # script provided by him.
  20. # References: <[email protected]>
  21. # http://lists.gnu.org/archive/html/bug-tar/2006-05/msg00038.html
  22. AT_SETUP([proper icontents initialization])
  23. AT_KEYWORDS([incremental incr04 icontents])
  24. m4_pushdef([NAME_PREFIX],[a/b/one_31_chars_long_file_name_])
  25. AT_TAR_CHECK([
  26. AT_CHECK_TIMESTAMP
  27. AT_TAR_MKHIER(a/b)
  28. awk 'BEGIN {
  29. for (i=1;i<=142;i++)
  30. printf("NAME_PREFIX[%03d]\n", i);
  31. }' < /dev/null | genfile --files-from -
  32. sleep 1
  33. echo "Initial dump"
  34. tar cvf a0.tar -g a.sna a
  35. mv a/b a/c
  36. echo "Incremental dump"
  37. tar cvf a1.tar -g a.sna a
  38. ],
  39. [0],
  40. [Initial dump
  41. a/
  42. a/b/
  43. m4_for(I,1,142,1,[NAME_PREFIX[]m4_if(m4_len(I),1,00,m4_len(I),2,0)I
  44. ])dnl
  45. Incremental dump
  46. a/
  47. a/c/
  48. ],
  49. [tar: a: Directory is new
  50. tar: a/b: Directory is new
  51. tar: a/c: Directory has been renamed from 'a/b'
  52. ],[],[],[gnu, oldgnu, posix])
  53. m4_popdef([NAME_PREFIX])
  54. AT_CLEANUP
  55. # End of incr04.at