summaryrefslogtreecommitdiff
path: root/test/hg-ssh
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-ssh
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-ssh')
-rwxr-xr-xtest/hg-ssh52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/hg-ssh b/test/hg-ssh
new file mode 100755
index 0000000..27ad610
--- /dev/null
+++ b/test/hg-ssh
@@ -0,0 +1,52 @@
+#!/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
+ if [ $# -ge 1 ]; then
+ args=$1 ; shift
+ fi
+ hg clone "$url"
+ if [ $? -ne 0 ]; then
+ echo "Failed to hg clone $url"
+ exit 1
+ fi
+ base=$(basename "$url")
+ test -d "$base" || exit 1
+ rm -rf "$base"
+ test -d "$base" && exit 1
+}
+
+HGPROJ=${HGPROJ:-test-project}
+
+list="
+ssh://$USER@hg.sv.gnu.org/${HGPROJ}
+ssh://$USER@hg.sv.nongnu.org/${HGPROJ}
+ssh://$USER@hg.savannah.gnu.org/${HGPROJ}
+ssh://$USER@hg.savannah.nongnu.org/${HGPROJ}
+"
+
+for url in $list; do
+ testit "$url"
+done
+
+exit 0