A few more manpage clarifications.
[rsync.git] / testsuite / 00-hello.test
1 #!/bin/sh
2
3 # Test some foundational things.
4
5 . "$suitedir/rsync.fns"
6
7 RSYNC_RSH="$scratchdir/src/support/lsh.sh"
8 export RSYNC_RSH
9
10 echo $0 running
11
12 $RSYNC --version || test_fail '--version output failed'
13
14 $RSYNC --info=help || test_fail '--info=help output failed'
15
16 $RSYNC --debug=help || test_fail '--debug=help output failed'
17
18 weird_name="A weird)name"
19
20 mkdir "$fromdir"
21 mkdir "$fromdir/$weird_name"
22
23 append_line() {
24     echo "$1"
25     echo "$1" >>"$fromdir/$weird_name/file"
26 }
27
28 append_line test1
29 checkit "$RSYNC -ai '$fromdir/' '$todir/'" "$fromdir" "$todir"
30
31 copy_weird() {
32     checkit "$RSYNC $1 --rsync-path='$RSYNC' '$2$fromdir/$weird_name/' '$3$todir/$weird_name'" "$fromdir" "$todir"
33 }
34
35 append_line test2
36 copy_weird '-ai' 'lh:' ''
37
38 append_line test3
39 copy_weird '-ai' '' 'lh:'
40
41 append_line test4
42 copy_weird '-ais' 'lh:' ''
43
44 append_line test5
45 copy_weird '-ais' '' 'lh:'
46
47 echo test6
48
49 touch "$fromdir/one" "$fromdir/two"
50 (cd "$fromdir" && $RSYNC -ai --old-args --rsync-path="$RSYNC" lh:'one two' "$todir/")
51 if [ ! -f "$todir/one" ] || [ ! -f "$todir/two" ]; then
52     test_fail "old-args copy of 'one two' failed"
53 fi
54
55 echo test7
56
57 rm "$todir/one" "$todir/two"
58 (cd "$fromdir" && RSYNC_OLD_ARGS=1 $RSYNC -ai --rsync-path="$RSYNC" lh:'one two' "$todir/")
59
60 # The script would have aborted on error, so getting here means we've won.
61 exit 0