summaryrefslogtreecommitdiff
path: root/testsuite/backup.test
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-09-20 04:59:01 +0000
committerWayne Davison <wayned@samba.org>2004-09-20 04:59:01 +0000
commit7d059d4c37e8b21260b8a76db4e1d4c3e08b9aa5 (patch)
tree92a4f8a5871fe119702bdacc08e4924f1cc92195 /testsuite/backup.test
parent9715c5899ad2cbe27429976a7a99303b2aef0ecd (diff)
downloadrsync-7d059d4c37e8b21260b8a76db4e1d4c3e08b9aa5.tar.gz
A simple test of the backup functionality.
Diffstat (limited to 'testsuite/backup.test')
-rw-r--r--testsuite/backup.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/backup.test b/testsuite/backup.test
new file mode 100644
index 00000000..59283620
--- /dev/null
+++ b/testsuite/backup.test
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+# Copyright (C) 2004 by Wayne Davison <wayned@samba.org>
+
+# This program is distributable under the terms of the GNU GPL (see
+# COPYING).
+
+# Test that the --backup option works right.
+
+. "$suitedir/rsync.fns"
+
+bakdir="$tmpdir/chk"
+
+mkdir "$fromdir" "$bakdir"
+name1="$fromdir/name1"
+name2="$fromdir/name2"
+echo "This is the file" > "$name1"
+echo "This is the other file" > "$name2"
+
+checkit "$RSYNC -avv --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
+
+$RSYNC -avv --backup "$todir/" "$chkdir/"
+
+echo "Extending the file" >> "$name1"
+echo "Extending the other file" >> "$name2"
+
+checkit "$RSYNC -avv --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
+
+diff -ru "$chkdir" "$bakdir"
+
+echo "Extending the file again" >> "$name1"
+echo "Extending the other file again" >> "$name2"
+
+checkit "$RSYNC -avv --inplace --backup --backup-dir=\"$bakdir\" \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
+
+diff -ru "$chkdir" "$bakdir"
+
+# The script would have aborted on error, so getting here means we've won.
+exit 0