summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Proulx <bob@proulx.com>2017-01-09 03:23:14 (GMT)
committerBob Proulx <bob@proulx.com>2017-01-09 03:23:14 (GMT)
commitdf4b3e3b27d962f22bf4383e75046f6fa479a18e (patch)
tree3f95a7edd5f347885de5683d35ce80336c582b4e
parent40b587531d5819bfa1336502aec26a69a7c45c00 (diff)
downloadsavannah-tests-df4b3e3b27d962f22bf4383e75046f6fa479a18e.zip
savannah-tests-df4b3e3b27d962f22bf4383e75046f6fa479a18e.tar.gz
savannah-tests-df4b3e3b27d962f22bf4383e75046f6fa479a18e.tar.bz2
Add svn tests
-rw-r--r--test/Makefile.am3
-rwxr-xr-xtest/svn-http49
-rwxr-xr-xtest/svn-https49
-rwxr-xr-xtest/svn-rsync42
-rwxr-xr-xtest/svn-ssh49
-rwxr-xr-xtest/svn-svn49
-rwxr-xr-xtest/svn-web78
7 files changed, 318 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index a3dfa1b..fcd6fd2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,8 @@
TESTS = \
bzr-bzr bzr-ssh bzr-web bzr-web-xfail bzr-rsync \
cvs-pserver cvs-ssh cvs-web cvs-rsync \
- git-git git-ssh git-http git-https git-rsync
+ git-git git-ssh git-http git-https git-rsync \
+ svn-svn svn-ssh svn-http svn-https svn-rsync
XFAIL_TESTS = bzr-web-xfail git-https
diff --git a/test/svn-http b/test/svn-http
new file mode 100755
index 0000000..0084386
--- /dev/null
+++ b/test/svn-http
@@ -0,0 +1,49 @@
+#!/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
+# Begin dash specific trap handling.
+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
+# End dash specific trap handling.
+
+tmpdir=$(mktemp -d -t "sv-test.XXXXXXXX") || exit 1
+
+cd "$tmpdir" || exit 1
+
+testit() {
+ url=$1 ; shift
+ fail=false
+ svn ls "$url" > out
+ if [ $? -ne 0 ]; then
+ echo "Failed to svn ls $url"
+ fail=true
+ fi
+ test -s out || fail=true
+ rm -f out
+ test -s out && fail=true
+ $fail && exit 1
+}
+
+list="
+http://svn.savannah.gnu.org/svn/administration/trunk
+http://svn.savannah.nongnu.org/svn/administration/trunk
+http://svn.sv.gnu.org/svn/administration/trunk
+http://svn.sv.nongnu.org/svn/administration/trunk
+"
+for url in $list; do
+ testit "$url"
+done
+
+exit 0
diff --git a/test/svn-https b/test/svn-https
new file mode 100755
index 0000000..405d47f
--- /dev/null
+++ b/test/svn-https
@@ -0,0 +1,49 @@
+#!/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
+# Begin dash specific trap handling.
+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
+# End dash specific trap handling.
+
+tmpdir=$(mktemp -d -t "sv-test.XXXXXXXX") || exit 1
+
+cd "$tmpdir" || exit 1
+
+testit() {
+ url=$1 ; shift
+ fail=false
+ svn ls "$url" > out
+ if [ $? -ne 0 ]; then
+ echo "Failed to svn ls $url"
+ fail=true
+ fi
+ test -s out || fail=true
+ rm -f out
+ test -s out && fail=true
+ $fail && exit 1
+}
+
+list="
+https://svn.savannah.gnu.org/svn/administration/trunk
+https://svn.savannah.nongnu.org/svn/administration/trunk
+https://svn.sv.gnu.org/svn/administration/trunk
+https://svn.sv.nongnu.org/svn/administration/trunk
+"
+for url in $list; do
+ testit "$url"
+done
+
+exit 0
diff --git a/test/svn-rsync b/test/svn-rsync
new file mode 100755
index 0000000..a601aca
--- /dev/null
+++ b/test/svn-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
+# Begin dash specific trap handling.
+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
+# End dash specific trap handling.
+
+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
+}
+
+testit rsync://svn.sv.gnu.org/svn/administration/
+testit rsync://svn.sv.nongnu.org/svn/administration/
+testit rsync://svn.savannah.gnu.org/svn/administration/
+testit rsync://svn.savannah.nongnu.org/svn/administration/
+
+exit 0
diff --git a/test/svn-ssh b/test/svn-ssh
new file mode 100755
index 0000000..02d59a7
--- /dev/null
+++ b/test/svn-ssh
@@ -0,0 +1,49 @@
+#!/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
+# Begin dash specific trap handling.
+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
+# End dash specific trap handling.
+
+tmpdir=$(mktemp -d -t "sv-test.XXXXXXXX") || exit 1
+
+cd "$tmpdir" || exit 1
+
+testit() {
+ url=$1 ; shift
+ fail=false
+ svn ls "$url" > out
+ if [ $? -ne 0 ]; then
+ echo "Failed to svn ls $url"
+ fail=true
+ fi
+ test -s out || fail=true
+ rm -f out
+ test -s out && fail=true
+ $fail && exit 1
+}
+
+list="
+svn+ssh://$USER@svn.sv.gnu.org/administration/trunk
+svn+ssh://$USER@svn.sv.nongnu.org/administration/trunk
+svn+ssh://$USER@svn.savannah.gnu.org/administration/trunk
+svn+ssh://$USER@svn.savannah.nongnu.org/administration/trunk
+"
+for url in $list; do
+ testit "$url"
+done
+
+exit 0
diff --git a/test/svn-svn b/test/svn-svn
new file mode 100755
index 0000000..dcaec81
--- /dev/null
+++ b/test/svn-svn
@@ -0,0 +1,49 @@
+#!/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
+# Begin dash specific trap handling.
+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
+# End dash specific trap handling.
+
+tmpdir=$(mktemp -d -t "sv-test.XXXXXXXX") || exit 1
+
+cd "$tmpdir" || exit 1
+
+testit() {
+ url=$1 ; shift
+ fail=false
+ svn ls "$url" > out
+ if [ $? -ne 0 ]; then
+ echo "Failed to svn ls $url"
+ fail=true
+ fi
+ test -s out || fail=true
+ rm -f out
+ test -s out && fail=true
+ $fail && exit 1
+}
+
+list="
+svn://svn.sv.gnu.org/administration/trunk
+svn://svn.sv.nongnu.org/administration/trunk
+svn://svn.savannah.gnu.org/administration/trunk
+svn://svn.savannah.nongnu.org/administration/trunk
+"
+for url in $list; do
+ testit "$url"
+done
+
+exit 0
diff --git a/test/svn-web b/test/svn-web
new file mode 100755
index 0000000..bb24866
--- /dev/null
+++ b/test/svn-web
@@ -0,0 +1,78 @@
+#!/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
+# Begin dash specific trap handling.
+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
+# End dash specific trap handling.
+
+tmpdir=$(mktemp -d -t "sv-test.XXXXXXXX") || exit 1
+
+cd "$tmpdir" || exit 1
+
+testit() {
+ url=$1 ; shift
+ wget -Oout "$url"
+ if [ $? -ne 0 ]; then
+ echo "Failed to web GET: $url"
+ exit 1
+ fi
+ test -s out || exit 1
+ rm -f out
+ test -s out && exit 1
+}
+
+testitxfail() {
+ url=$1 ; shift
+ wget -Oout "$url"
+ if [ $? -eq 0 ]; then
+ echo "Worked to web GET: $url"
+ exit 1
+ fi
+ test -s out && exit 1
+ echo "XFAIL: $url"
+}
+
+list="
+//svn.savannah.gnu.org/
+//svn.savannah.gnu.org/viewvc/
+"
+for url in $list; do
+ testit "https:$url"
+done
+for url in $list; do
+ testit "http:$url"
+done
+
+testrobots() {
+ url=$1 ; shift
+ wget -Oout "$url"
+ fail=false
+ if [ $? -ne 0 ]; then
+ echo "Failed to web GET: $url"
+ fail=true
+ fi
+ test -s out || fail=true
+ grep ^User-agent: out || fail=true
+ grep ^Disallow: out || fail=true
+ rm -f out
+ test -s out && fail=true
+ $fail && exit 1
+}
+
+testrobots https://svn.savannah.gnu.org/robots.txt
+testrobots http://svn.savannah.gnu.org/robots.txt
+
+exit 0