4 # Copyright (C) 1998 Philip Hands <http://www.hands.com/~phil/>
6 # This program is distributable under the terms of the GNU GPL (see COPYING)
8 # This is a simple test script that tests a few rsync
9 # features to make sure I haven't broken them before a release.
15 This set of tests is not completely portable. It is intended for developers
16 not for end users. You may experience failures on some platforms that
17 do not indicate a problem with rsync.
22 TMP=/tmp/rsync-test.$$
34 mkdir ${FROM}/emptydir
35 ps ax > ${FROM}/pslist
36 echo -n "This file has no trailing lf" > ${FROM}/nolf
37 ln -s nolf ${FROM}/nolf-symlink
38 cat /etc/inittab /etc/services /etc/resolv.conf > ${FROM}/${F1}
40 cp ${FROM}/${F1} ${FROM}/dir
43 echo -n "Test $4: $5:"
46 echo "Running: \"$1\"" >${log}
48 eval "$1 || failed=YES" >>${log} 2>&1
50 echo "-------------">>${log}
51 echo "check how the files compare with diff:">>${log}
53 diff -ur $2 $3 >>${log} || failed=YES
54 echo "-------------">>${log}
55 echo "check how the directory listings compare with diff:">>${log}
57 ls -la $2 > ${TMP}/ls-from
58 ls -la $3 > ${TMP}/ls-to
59 diff -u ${TMP}/ls-from ${TMP}/ls-to >>${log} || failed=YES
60 if [ -z "${failed}" ] ; then
72 Failures have occured.
74 You can find the output of the tests in these files:
84 echo "Tests Completed Successfully :-)"
88 # Main script starts here
90 checkit "rsync -av ${FROM}/ ${TO}" ${FROM}/ ${TO} \
93 ln ${FROM}/pslist ${FROM}/dir
94 checkit "rsync -avH ${FROM}/ ${TO}" ${FROM}/ ${TO} \
98 checkit "rsync -avH ${FROM}/ ${TO}" ${FROM}/ ${TO} \
101 echo "extra line" >> ${TO}/${F1}
102 checkit "rsync -avH ${FROM}/ ${TO}" ${FROM}/ ${TO} \
105 cp ${FROM}/${F1} ${TO}/ThisShouldGo
106 checkit "rsync --delete -avH ${FROM}/ ${TO}" ${FROM}/ ${TO} \
109 LONGDIR=${FROM}/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job
112 ls -la / > ${LONGDIR}/2
113 checkit "rsync --delete -avH ${FROM}/ ${TO}" ${FROM}/ ${TO} \
116 if type ssh >/dev/null ; then
118 checkit "rsync -avH -e ssh ${FROM}/ localhost:${TO}" ${FROM}/ ${TO} \
121 mv ${TO}/${F1} ${TO}/ThisShouldGo
122 checkit "rsync --delete -avH -e ssh ${FROM}/ localhost:${TO}" ${FROM}/ ${TO}\
123 8 "ssh: renamed file"
126 echo "**** Skipping SSH tests because ssh is not in the path
\a ****"
130 checkforlogs ${LOG}.?