| 1 |
# Process this file with autom4te to create testsuite. -*- Autotest -*- |
| 2 |
|
| 3 |
# Test suite for GNU tar. |
| 4 |
# Copyright 2009-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: when a file in a deep directory disappeared during creation |
| 22 |
# of incremental dump, tar v. <1.23 would exit with TAREXIT_FAILURE (2). |
| 23 |
# However, such events are quite common and don't necessarily constitute |
| 24 |
# an error. Exiting with code 2 in such cases makes it impossible to |
| 25 |
# distinguish serious errors from benign ones. |
| 26 |
# |
| 27 |
# Starting from tar 1.22.90, tar exits with TAREXIT_DIFFERS (1) |
| 28 |
# instead. |
| 29 |
# |
| 30 |
# Reported by: Solar Designer <[email protected]> |
| 31 |
# |
| 32 |
# References: <[email protected]> |
| 33 |
# http://lists.gnu.org/archive/html/bug-tar/2009-03/msg00000.html |
| 34 |
# |
| 35 |
|
| 36 |
AT_SETUP([file removed as we read it]) |
| 37 |
AT_KEYWORDS([create incremental listed filechange filerem filerem01]) |
| 38 |
|
| 39 |
AT_TAR_CHECK([ |
| 40 |
mkdir dir |
| 41 |
mkdir dir/sub |
| 42 |
genfile --file dir/file1 |
| 43 |
genfile --file dir/sub/file2 |
| 44 |
|
| 45 |
genfile --run --checkpoint=3 --unlink dir/file1 -- \ |
| 46 |
tar --blocking-factor=1 -c -f archive.tar \ |
| 47 |
--listed-incremental db -v dir >/dev/null |
| 48 |
], |
| 49 |
[1], |
| 50 |
[ignore], |
| 51 |
[tar: dir: Directory is new |
| 52 |
tar: dir/sub: Directory is new |
| 53 |
tar: dir/file1: File removed before we read it |
| 54 |
],[],[],[gnu, posix]) |
| 55 |
|
| 56 |
# Timing information: |
| 57 |
# |
| 58 |
# For -Hgnu the above command line takes about 8 seconds to execute and |
| 59 |
# produces: |
| 60 |
# |
| 61 |
# tar: dir: Directory is new |
| 62 |
# tar: dir/sub: Directory is new |
| 63 |
# dir/ |
| 64 |
# tar: Write checkpoint 1 |
| 65 |
# tar: Write checkpoint 2 |
| 66 |
# dir/sub/ |
| 67 |
# tar: Write checkpoint 3 |
| 68 |
# tar: Write checkpoint 4 |
| 69 |
# dir/file1 |
| 70 |
# tar: Write checkpoint 5 |
| 71 |
# dir/sub/file2 |
| 72 |
# tar: Write checkpoint 6 |
| 73 |
# tar: Write checkpoint 7 |
| 74 |
# tar: Write checkpoint 8 |
| 75 |
# |
| 76 |
# For -Hposix the above command line takes about 14 seconds to execute and |
| 77 |
# produces: |
| 78 |
# |
| 79 |
# ./tar: dir: Directory is new |
| 80 |
# ./tar: dir/sub: Directory is new |
| 81 |
# dir/ |
| 82 |
# ./tar: Write checkpoint 1 |
| 83 |
# ./tar: Write checkpoint 2 |
| 84 |
# ./tar: Write checkpoint 3 |
| 85 |
# dir/sub/ |
| 86 |
# ./tar: Write checkpoint 4 |
| 87 |
# ./tar: Write checkpoint 5 |
| 88 |
# ./tar: Write checkpoint 6 |
| 89 |
# dir/file1 |
| 90 |
# ./tar: Write checkpoint 7 |
| 91 |
# ./tar: Write checkpoint 8 |
| 92 |
# ./tar: Write checkpoint 9 |
| 93 |
# dir/sub/file2 |
| 94 |
# ./tar: Write checkpoint 10 |
| 95 |
# ./tar: Write checkpoint 11 |
| 96 |
# ./tar: Write checkpoint 12 |
| 97 |
# ./tar: Write checkpoint 13 |
| 98 |
# ./tar: Write checkpoint 14 |
| 99 |
|
| 100 |
|
| 101 |
AT_CLEANUP |