3 # Copyright (C) 2001 by Martin Pool <mbp@samba.org>
5 # This program is distributable under the terms of the GNU GPL (see
8 # We don't really want to start the server listening, because that
9 # might interfere with the security or operation of the test machine.
10 # Instead we use the fake-connect feature to dynamically assign a pair
13 # Having started the server we try some basic operations against it:
15 # getting a list of module
16 # listing files in a module
18 # uploading to a module
19 # checking the log file
20 # password authentication
22 . "$suitedir/rsync.fns"
24 chkfile="$scratchdir/rsync.chk"
25 outfile="$scratchdir/rsync.out"
27 SSH="src/support/lsh --no-cd"
28 DIR_REPL='s/^\(d[^ ]*\) *[0-9][0-9]* /\1 DIR /'
29 LS_REPL='s;[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9];####/##/## ##:##:##;'
33 makepath "$fromdir/foo" "$fromdir/bar/baz"
35 echo one >"$fromdir/foo/one"
36 echo two >"$fromdir/bar/two"
37 echo three >"$fromdir/bar/baz/three"
41 ln -s test-rsyncd.conf rsyncd.conf
46 # Root needs to specify the config file, or it uses /etc/rsyncd.conf.
47 echo "Forcing --config=$conf"
48 confopt=" --config=$conf"
52 $RSYNC -ve "$SSH" --rsync-path="$RSYNC$confopt" localhost::
54 RSYNC_CONNECT_PROG="$RSYNC --config=$conf --daemon"
55 export RSYNC_CONNECT_PROG
57 $RSYNC -v localhost:: \
59 # These have a space-padded 15-char name, then a tab, then a comment.
60 sed 's/NOCOMMENT//' <<EOT >"$chkfile"
63 test-scratch NOCOMMENT
65 diff $diffopt "$chkfile" "$outfile" || test_fail "test 1 failed"
67 $RSYNC -r localhost::test-hidden \
68 | sed "$DIR_REPL" | sed "$LS_REPL" \
71 drwxr-xr-x DIR ####/##/## ##:##:## .
72 drwxr-xr-x DIR ####/##/## ##:##:## bar
73 -rw-r--r-- 4 ####/##/## ##:##:## bar/two
74 drwxr-xr-x DIR ####/##/## ##:##:## bar/baz
75 -rw-r--r-- 6 ####/##/## ##:##:## bar/baz/three
76 drwxr-xr-x DIR ####/##/## ##:##:## foo
77 -rw-r--r-- 4 ####/##/## ##:##:## foo/one
79 diff $diffopt "$chkfile" "$outfile" || test_fail "test 2 failed"
81 $RSYNC -r localhost::test-from/f* \
82 | sed "$DIR_REPL" | sed "$LS_REPL" \
85 drwxr-xr-x DIR ####/##/## ##:##:## foo
86 -rw-r--r-- 4 ####/##/## ##:##:## foo/one
88 diff $diffopt "$chkfile" "$outfile" || test_fail "test 3 failed"