4
0

incr04.at 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. 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/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