Implement the "wait" checkpoint action.
[tar.git] / tests / dirrem01.at
blobb82be02b4d844ddd89dc7341c730cf90b98fcebe
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright 2017-2018 Free Software Foundation, Inc.
6 # This file is part of GNU tar.
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.
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.
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/>.
21 # Description:
23 # When a directory in a deep directory disappeared during creation
24 # of incremental dump, tar <= 1.29 exits with TAREXIT_FAILURE (2).
26 # In case of files tar does not return TAREXIT_FAILURE, but instead
27 # it prints a warning and exits with TAREXIT_DIFFERS.
29 # This test checks whether this behaviour is mimicked for directories, too.
31 # Remark: This file is based on 'filerem01.at', which is the test-case for
32 # a vanishing file.
34 AT_SETUP([directory removed before reading])
35 AT_KEYWORDS([create incremental listed dirchange dirrem dirrem01])
37 AT_TAR_CHECK([
38 mkdir dir
39 mkdir dir/sub
40 genfile --file dir/file1
41 genfile --file dir/sub/file2
43 case "$TEST_TAR_FORMAT" in
44 posix) CPT=5;;
45 gnu)   CPT=3;;
46 *)     AT_SKIP_TEST
47 esac
49 genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
50        tar --blocking-factor=1 -c -f archive.tar \
51        --listed-incremental db -v dir >/dev/null
53 [1],
54 [ignore],
55 [tar: dir: Directory is new
56 tar: dir/sub: Directory is new
57 tar: dir/sub: file changed as we read it
58 tar: dir/sub: File removed before we read it
59 ],[],[],[gnu,posix])
61 AT_CLEANUP