incr04.at 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2006, 2007 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. # 02110-1301, USA.
  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_define([NAME_PREFIX],[a/b/one_31_chars_long_file_name_])
  26. AT_TAR_CHECK([
  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. 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/b: Directory is new
  49. tar: a/c: Directory has been renamed from `a/b'
  50. ],[],[],[gnu, oldgnu, posix])
  51. AT_CLEANUP
  52. # End of incr04.at