4
0

incr04.at 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-2007, 2009, 2013 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_define([NAME_PREFIX],[a/b/one_31_chars_long_file_name_])
  25. AT_TAR_CHECK([
  26. AT_TAR_MKHIER(a/b)
  27. awk 'BEGIN {
  28. for (i=1;i<=142;i++)
  29. printf("NAME_PREFIX[%03d]\n", i);
  30. }' < /dev/null | genfile --files-from -
  31. sleep 1
  32. echo "Initial dump"
  33. tar cvf a0.tar -g a.sna a
  34. mv a/b a/c
  35. echo "Incremental dump"
  36. tar cvf a1.tar -g a.sna a
  37. ],
  38. [0],
  39. [Initial dump
  40. a/
  41. a/b/
  42. m4_for(I,1,142,1,[NAME_PREFIX[]m4_if(m4_len(I),1,00,m4_len(I),2,0)I
  43. ])dnl
  44. Incremental dump
  45. a/
  46. a/c/
  47. ],
  48. [tar: a: Directory is new
  49. tar: a/b: Directory is new
  50. tar: a/c: Directory has been renamed from 'a/b'
  51. ],[],[],[gnu, oldgnu, posix])
  52. AT_CLEANUP
  53. # End of incr04.at