summaryrefslogtreecommitdiff
path: root/test/hg-rsync
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2017-01-12 19:41:36 (GMT)
committerAssaf Gordon <assafgordon@gmail.com>2017-01-12 19:41:36 (GMT)
commit833ec293858d40d7cf98d5b37c92fc642a241033 (patch)
treed0e3991a01ab1c42ac8b67e79b8f5a93635e94e8 /test/hg-rsync
parent35be2c5bcf958128ed6254ed1a8b814d17c6640d (diff)
downloadsavannah-tests-833ec293858d40d7cf98d5b37c92fc642a241033.zip
savannah-tests-833ec293858d40d7cf98d5b37c92fc642a241033.tar.gz
savannah-tests-833ec293858d40d7cf98d5b37c92fc642a241033.tar.bz2
new tests: hg-{hg,rsync,ssh,web}
Diffstat (limited to 'test/hg-rsync')
-rwxr-xr-xtest/hg-rsync42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/hg-rsync b/test/hg-rsync
new file mode 100755
index 0000000..24bbf98
--- /dev/null
+++ b/test/hg-rsync
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Copyright 2017 Bob Proulx <bob@proulx.com>
+# You may freely use, modify and/or distribute this file.
+
+# Ensure a standard behavior regardless of caller locale setting.
+export LC_ALL=C
+
+unset tmpdir
+cleanup() {
+ test -n "$tmpdir" && rm -rf "$tmpdir" && unset tmpdir
+}
+trap "cleanup" EXIT
+trap "cleanup; trap - HUP; kill -HUP $$" HUP
+trap "cleanup; trap - INT; kill -INT $$" INT
+trap "cleanup; trap - QUIT; kill -QUIT $$" QUIT
+trap "cleanup; trap - TERM; kill -TERM $$" TERM
+
+tmpdir=$(mktemp -d -t "sv-test.XXXXXXXX") || exit 1
+
+cd "$tmpdir" || exit 1
+
+testit() {
+ url=$1 ; shift
+ rsync "$url" > out
+ if [ $? -ne 0 ]; then
+ echo "Failed: rsync $url"
+ exit 1
+ fi
+ test -s out || exit 1
+ rm -f out
+ test -s out && exit 1
+}
+
+HGPROJ=${HGPROJ:-test-project}
+
+testit rsync://hg.savannah.gnu.org/hg/${HGPROJ}
+testit rsync://hg.savannah.nongnu.org/hg/${HGPROJ}
+testit rsync://hg.sv.gnu.org/hg/${HGPROJ}
+testit rsync://hg.sv.nongnu.org/hg/${HGPROJ}
+
+exit 0