this is a little test script to test some of rsyncs features
[rsync/rsync.git] / test.sh
CommitLineData
5806b30f
AT
1#!/bin/sh -e
2# This is a simple test script that tests a few rsync
3# features to make sure I haven't broken them before a release. Thanks
4# to Phil Hands for writing this
5
6export PATH=.:$PATH
7TMP=/tmp/rsync-test.$$
8F1=README
9
10mkdir $TMP
11
12pause() {
13 echo ... press enter to continue
14 read
15}
16
17echo "Test 1 basic operation"
18rsync -av testin/ ${TMP}/rsync
19diff -ur testin/ ${TMP}/rsync
20pause
21
22echo "Test 2 - one file"
23rm ${TMP}/rsync/${F1}
24rsync -av testin/ ${TMP}/rsync
25diff -ur testin/ ${TMP}/rsync
26pause
27
28echo "Test 3 - extra data"
29echo "extra line" >> ${TMP}/rsync/${F1}
30rsync -av testin/ ${TMP}/rsync
31diff -ur testin/ ${TMP}/rsync
32pause
33
34echo "Test 4 - --delete"
35cp testin/${F1} ${TMP}/rsync/f1
36rsync --delete -av testin/ ${TMP}/rsync
37diff -ur testin/ ${TMP}/rsync
38pause
39
40echo "Test 5 (uses ssh, so will fail if you don't have it) "
41rm -rf ${TMP}/rsync
42rsync -av -e ssh testin/ localhost:${TMP}/rsync
43diff -ur testin/ ${TMP}/rsync
44pause
45
46echo "Test 6 (uses ssh, so will fail if you don't have it) "
47mv ${TMP}/rsync/${F1} ${TMP}/rsync/f1
48rsync --delete -av -e ssh testin/ localhost:${TMP}/rsync
49diff -ur testin/ ${TMP}/rsync
50pause
51
52rm -rf ${TMP}
53
54echo Tests Completed