Clean up Phil's test more.
[rsync/rsync.git] / testsuite / hands.test
CommitLineData
068a7221
MP
1#!/bin/sh
2
3# Copyright (C) 1998,1999 Philip Hands <phil@hands.com>
4#
5# This program is distributable under the terms of the GNU GPL (see COPYING)
6#
7# This is a simple test script that tests a few rsync
8# features to make sure I haven't broken them before a release.
9#
10#
11
3a4c683f
MP
12. "$suitedir/rsync.fns"
13
14hands_setup
068a7221 15
068a7221
MP
16
17checkforlogs() {
18 # skip it if we're under debian-test
19 if test -n "${Debian}" ; then return 0 ; fi
20
3fedd74b
MP
21 if [ -f $1 -a -s $1 ] ; then
22 echo "Failures have occurred. $1 follows:" >&2
23 cat $1 >&2
24 exit 1
068a7221 25 else
068a7221
MP
26 echo ""
27 echo "Tests Completed Successfully :-)"
28 fi
29}
30
31# Main script starts here
32
33runtest "basic operation" 'checkit "$RSYNC -av ${FROM}/ ${TO}" ${FROM}/ ${TO}'
34
35ln ${FROM}/pslist ${FROM}/dir
36runtest "hard links" 'checkit "$RSYNC -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
37
38rm ${TO}/${F1}
39runtest "one file" 'checkit "$RSYNC -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
40
41echo "extra line" >> ${TO}/${F1}
42runtest "extra data" 'checkit "$RSYNC -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
43
44cp ${FROM}/${F1} ${TO}/ThisShouldGo
45runtest " --delete" 'checkit "$RSYNC --delete -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
46
47LONGDIR=${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
48mkdir -p ${LONGDIR}
49date > ${LONGDIR}/1
50ls -la / > ${LONGDIR}/2
51runtest "long paths" 'checkit "$RSYNC --delete -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
52
068a7221
MP
53rm -rf ${TO}
54mkdir -p ${FROM}2/dir/subdir
55cp -a ${FROM}/dir/subdir/subsubdir ${FROM}2/dir/subdir
3fedd74b 56cp ${FROM}/dir/* ${FROM}2/dir || :
068a7221
MP
57runtest "excludes" 'checkit "$RSYNC -vv -Hlrt --delete --include /dir/ --include /dir/\* --include /dir/\*/subsubdir --include /dir/\*/subsubdir/\*\* --exclude \*\* ${FROM}/dir ${TO}" ${FROM}2/ ${TO}'
58rm -r ${FROM}2
59
60checkforlogs ${LOG}.?