Allow $RSYNC_TEST_TMP to indicate a good tmp dir for our tests.
[rsync/rsync.git] / testsuite / hands.test
CommitLineData
068a7221
MP
1#!/bin/sh
2
e553d27f
MP
3# Copyright (C) 1998, 1999 by Philip Hands <phil@hands.com>
4# Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org>
068a7221
MP
5#
6# This program is distributable under the terms of the GNU GPL (see COPYING)
068a7221 7
3a4c683f
MP
8. "$suitedir/rsync.fns"
9
10hands_setup
068a7221 11
741597c2 12DEBUG_OPTS="--debug=all0,deltasum0"
eabc85ef 13
068a7221
MP
14# Main script starts here
15
8624daa7 16runtest "basic operation" 'checkit "$RSYNC -av \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
068a7221 17
8624daa7 18ln "$fromdir/filelist" "$fromdir/dir"
eabc85ef 19runtest "hard links" 'checkit "$RSYNC -avH $DEBUG_OPTS \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
068a7221 20
8624daa7 21rm "$todir/text"
eabc85ef 22runtest "one file" 'checkit "$RSYNC -avH $DEBUG_OPTS \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
068a7221 23
8624daa7 24echo "extra line" >> "$todir/text"
eabc85ef 25runtest "extra data" 'checkit "$RSYNC -avH $DEBUG_OPTS --no-whole-file \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
068a7221 26
8624daa7 27cp "$fromdir/text" "$todir/ThisShouldGo"
eabc85ef 28runtest " --delete" 'checkit "$RSYNC --delete -avH $DEBUG_OPTS \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
68618b88 29
46ad63b7
WD
30cd "$tmpdir"
31rm -rf to from/*dir
32
33# Do the real copy, touch up the parent-dir's time, and then check the copy.
34$RSYNC -av from/* to/
35checkit "$RSYNC -av --exclude='*' from/ to/" "$fromdir" "$todir"
36
05118158 37# The script would have aborted on error, so getting here means we've won.
68618b88 38exit 0