Allow basic connectivity check via rrsync
[rsync.git] / testsuite / mkpath.test
blob8046345418f8f00c78cb100da74fa1319b51e992
1 #!/bin/sh
3 . "$suitedir/rsync.fns"
5 makepath "$fromdir"
6 makepath "$todir"
8 cp_p "$srcdir/rsync.h" "$fromdir/text"
9 cp_p "$srcdir/configure.ac" "$fromdir/extra"
11 cd "$tmpdir"
13 deep_dir=to/foo/bar/baz/down/deep
15 # Check that we can create several levels of dest dir
16 $RSYNC -aiv --mkpath from/text $deep_dir/new
17 test -f $deep_dir/new || test_fail "'new' file not found in $deep_dir dir"
18 rm -rf to/foo
20 $RSYNC -aiv --mkpath from/text $deep_dir/
21 test -f $deep_dir/text || test_fail "'text' file not found in $deep_dir dir"
22 rm $deep_dir/text
24 # Make sure we can handle an existing path
25 mkdir $deep_dir/new
26 $RSYNC -aiv --mkpath from/text $deep_dir/new
27 test -f $deep_dir/new/text || test_fail "'text' file not found in $deep_dir/new dir"
29 # ... and an existing path when an alternate dest filename is specified
30 $RSYNC -aiv --mkpath from/text $deep_dir/new/text2
31 test -f $deep_dir/new/text2 || test_fail "'text2' file not found in $deep_dir/new dir"
32 rm -rf to/foo
34 # Try the tests again with multiple source args
35 $RSYNC -aiv --mkpath from/ $deep_dir
36 test -f $deep_dir/extra || test_fail "'extra' file not found in $deep_dir dir"
37 rm -rf to/foo
39 $RSYNC -aiv --mkpath from/ $deep_dir/
40 test -f $deep_dir/text || test_fail "'text' file not found in $deep_dir dir"
42 # Make sure that we can handle no path
43 $RSYNC -aiv --mkpath from/text to_text
44 test -f to_text || test_fail "'to_text' file not found in current dir"
46 # The script would have aborted on error, so getting here means we've won.
47 exit 0