* doc/tar.texi: Define reproducibility.
[tar.git] / tests / dirrem02.at
blob63973e1ccb31344acc708f9a226136d165d1f801
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright 2017-2023 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 an explicitly named directory disappears during creation
24 # of incremental dump, tar should still exit with TAREXIT_FAILURE (2).
26 # For further details see dirrem01.at
28 # Remark: This file is based on 'filerem01/02.at', which are test-cases for
29 # vanishing files.
31 AT_SETUP([explicitly named directory removed before reading])
32 AT_KEYWORDS([create incremental listed dirchange dirrem dirrem02])
34 AT_TAR_CHECK([
35 mkdir dir
36 mkdir dir/sub
37 genfile --file dir/file1
38 genfile --file dir/sub/file2
40 case "$TEST_TAR_FORMAT" in
41 posix) CPT=5;;
42 gnu)   CPT=3;;
43 *)     AT_SKIP_TEST
44 esac
46 genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
47        tar --blocking-factor=1 -c -f archive.tar \
48        --listed-incremental db \
49        --warning=no-file-changed \
50        -v dir dir/sub >/dev/null
52 [2],
53 [ignore],
54 [tar: dir: Directory is new
55 tar: dir/sub: Directory is new
56 tar: dir/sub: Cannot open: No such file or directory
57 tar: Exiting with failure status due to previous errors
58 ],[],[],[gnu,posix])
60 AT_CLEANUP