incr04.at 2.0 KB

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