Blame tests/p_rsync/10-rsync-test.sh

Christoph Galuschka dc5f9b
#!/bin/sh
Christoph Galuschka dc5f9b
# Author: Athmane Madjoudj <athmanem@gmail.com>
Christoph Galuschka dc5f9b
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka dc5f9b
Christoph Galuschka 0973c7
t_Log "Running $0 - rsyncd can rsync from/to local machine."
Christoph Galuschka dc5f9b
Christoph Galuschka 0973c7
# create settings to run test
Christoph Galuschka dc5f9b
Christoph Galuschka 0973c7
PATH2FILE='/var/tmp'
Christoph Galuschka 0973c7
FILE='rsync-test'
Christoph Galuschka 0973c7
cat > $PATH2FILE/$FILE <
Christoph Galuschka dc5f9b
Testing rsync
Christoph Galuschka dc5f9b
EOF
Christoph Galuschka dc5f9b
Christoph Galuschka 0973c7
cat > /etc/rsyncd.conf <
Christoph Galuschka 0973c7
gid = root
Christoph Galuschka 0973c7
uid = root
Christoph Galuschka 0973c7
read only = true
Christoph Galuschka 0973c7
use chroot = true
Christoph Galuschka 0973c7
log file = /var/log/rsyncd.log
Christoph Galuschka 0973c7
pid file = /var/run/rsyncd.pid
Christoph Galuschka 0973c7
hosts allow = 127.0.0.1
Christoph Galuschka 0973c7
[centos-test]
Christoph Galuschka 0973c7
 path = $PATH2FILE
Christoph Galuschka 0973c7
 list = yes
Christoph Galuschka 0973c7
 exclude = *
Christoph Galuschka 0973c7
 include = $FILE
Christoph Galuschka 0973c7
EOF
Christoph Galuschka 0973c7
Christoph Galuschka 0973c7
t_ServiceControl xinetd restart
Christoph Galuschka 0973c7
Christoph Galuschka 0973c7
# Trying to rsync
Christoph Galuschka 0973c7
rsync --recursive --verbose --include=$FILE --exclude=* rsync://127.0.0.1/centos-test /var/log/
Christoph Galuschka 0973c7
Christoph Galuschka 0973c7
t_CheckExitStatus $?
Christoph Galuschka dc5f9b
Christoph Galuschka dc5f9b
#reversing changes
Christoph Galuschka 0973c7
/bin/rm $PATH2FILE/$FILE
Christoph Galuschka 0973c7
/bin/rm /etc/rsyncd.conf
Christoph Galuschka 0973c7
/bin/rm /var/log/$FILE
Christoph Galuschka 0973c7
Christoph Galuschka 0973c7
t_ServiceControl xinetd restart