Unsnarl missing_below/dry_run logic.
[rsync/rsync.git] / testsuite / missing.test
1 #! /bin/sh
2
3 # This program is distributable under the terms of the GNU GPL (see
4 # COPYING).
5
6 # Test three bugs fixed by my redoing of the missing_below logic.
7
8 . $srcdir/testsuite/rsync.fns
9
10 mkdir "$fromdir" "$todir"
11 mkdir "$fromdir/subdir"
12 echo data >"$fromdir/subdir/file"
13 echo data >"$todir/other"
14
15 # Test 1: Too much "not creating new..." output on a dry run
16 $RSYNC -n -r --ignore-non-existing -vv "$fromdir/" "$todir/" | tee "$scratchdir/out"
17 if grep 'not creating new.*subdir/file' "$scratchdir/out" >/dev/null; then
18         test_fail 'test 1 failed'
19 fi
20
21 # Test 2: Attempt to make a fuzzy dirlist for a dir not created on a dry run
22 $RSYNC -n -r -R --no-implied-dirs -y "$fromdir/./subdir/file" "$todir/" \
23         || test_fail 'test 2 failed'
24
25 # Test 3: --delete-after pass skipped when last dir is dry-missing
26 $RSYNC -n -r --delete-after -i "$fromdir/" "$todir/" | tee "$scratchdir/out"
27 grep '^\*deleting   other' "$scratchdir/out" >/dev/null \
28         || test_fail 'test 3 failed'