| 1 |
# Process this file with autom4te to create testsuite. -*- Autotest -*- |
| 2 |
|
| 3 |
# Test suite for GNU tar. |
| 4 |
# Copyright 2006-2023 Free Software Foundation, Inc. |
| 5 |
|
| 6 |
# This file is part of GNU tar. |
| 7 |
|
| 8 |
# GNU tar is free software; you can redistribute it and/or modify |
| 9 |
# it under the terms of the GNU General Public License as published by |
| 10 |
# the Free Software Foundation; either version 3 of the License, or |
| 11 |
# (at your option) any later version. |
| 12 |
|
| 13 |
# GNU tar is distributed in the hope that it will be useful, |
| 14 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
# GNU General Public License for more details. |
| 17 |
|
| 18 |
# You should have received a copy of the GNU General Public License |
| 19 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
|
| 21 |
# Description: Rewritten incremental backup support (2006-05-08) |
| 22 |
# missed initialization of all struct directory members in make_directory, |
| 23 |
# which lead to random core dumps. |
| 24 |
# Reported by Sergey Myasnikov <[email protected]>. This testcase uses original |
| 25 |
# script provided by him. |
| 26 |
# References: <[email protected]> |
| 27 |
# http://lists.gnu.org/archive/html/bug-tar/2006-05/msg00038.html |
| 28 |
|
| 29 |
AT_SETUP([proper icontents initialization]) |
| 30 |
AT_KEYWORDS([incremental incr04 icontents]) |
| 31 |
|
| 32 |
m4_pushdef([NAME_PREFIX],[a/b/one_31_chars_long_file_name_]) |
| 33 |
|
| 34 |
AT_TAR_CHECK([ |
| 35 |
AT_CHECK_TIMESTAMP |
| 36 |
AT_TAR_MKHIER(a/b) |
| 37 |
awk 'BEGIN { |
| 38 |
for (i=1;i<=142;i++) |
| 39 |
printf("NAME_PREFIX[%03d]\n", i); |
| 40 |
}' < /dev/null | genfile --files-from - |
| 41 |
|
| 42 |
sleep 1 |
| 43 |
|
| 44 |
echo "Initial dump" |
| 45 |
tar cvf a0.tar -g a.sna a |
| 46 |
mv a/b a/c |
| 47 |
echo "Incremental dump" |
| 48 |
tar cvf a1.tar -g a.sna a |
| 49 |
], |
| 50 |
[0], |
| 51 |
[Initial dump |
| 52 |
a/ |
| 53 |
a/b/ |
| 54 |
m4_for(I,1,142,1,[NAME_PREFIX[]m4_if(m4_len(I),1,00,m4_len(I),2,0)I |
| 55 |
])dnl |
| 56 |
Incremental dump |
| 57 |
a/ |
| 58 |
a/c/ |
| 59 |
], |
| 60 |
[tar: a: Directory is new |
| 61 |
tar: a/b: Directory is new |
| 62 |
tar: a/c: Directory has been renamed from 'a/b' |
| 63 |
],[],[],[gnu, oldgnu, posix]) |
| 64 |
|
| 65 |
m4_popdef([NAME_PREFIX]) |
| 66 |
AT_CLEANUP |
| 67 |
|
| 68 |
# End of incr04.at |