summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Proulx <bob@proulx.com>2017-01-09 02:20:16 (GMT)
committerBob Proulx <bob@proulx.com>2017-01-09 02:32:05 (GMT)
commit259d7364460d5a068ea12c926b6e801f7c148d12 (patch)
tree50fff009501c1781c1e32d742c1cb3d75446aee0
parentcf4044c5e55b7ef19b129fd8ee6c18175f4fbf1b (diff)
downloadsavannah-tests-259d7364460d5a068ea12c926b6e801f7c148d12.zip
savannah-tests-259d7364460d5a068ea12c926b6e801f7c148d12.tar.gz
savannah-tests-259d7364460d5a068ea12c926b6e801f7c148d12.tar.bz2
Add cvs tests.
-rw-r--r--test/Makefile.am1
-rwxr-xr-xtest/cvs-pserver50
-rwxr-xr-xtest/cvs-rsync42
-rwxr-xr-xtest/cvs-ssh62
-rwxr-xr-xtest/cvs-web78
5 files changed, 233 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index ec4f53c..a3dfa1b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,6 @@
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
XFAIL_TESTS = bzr-web-xfail git-https
diff --git a/test/cvs-pserver b/test/cvs-pserver
new file mode 100755
index 0000000..ad35d9c
--- /dev/null
+++ b/test/cvs-pserver
@@ -0,0 +1,50 @@
+#!/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
+ base=$(basename "$url")
+ cvs -z3 -d"$url" co "$base"
+ if [ $? -ne 0 ]; then
+ echo "Failed to cvs branch $url"
+ exit 1
+ fi
+ test -d "$base" || exit 1
+ rm -rf "$base"
+ test -d "$base" && exit 1
+}
+
+list="
+:pserver:anonymous@cvs.savannah.gnu.org:/cvsroot/hello
+:pserver:anonymous@cvs.savannah.gnu.org:/sources/hello
+:pserver:anonymous@cvs.savannah.gnu.org:/srv/cvs/sources/hello
+:pserver:anonymous@cvs.savannah.gnu.org:/srv/cvs/web/hello
+:pserver:anonymous@cvs.savannah.gnu.org:/web/hello
+:pserver:anonymous@cvs.savannah.gnu.org:/webcvs/hello
+"
+for url in $list; do
+ testit "$url"
+done
+
+exit 0
diff --git a/test/cvs-rsync b/test/cvs-rsync
new file mode 100755
index 0000000..96c75da
--- /dev/null
+++ b/test/cvs-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://cvs.sv.gnu.org/sources/hello/
+testit rsync://cvs.sv.nongnu.org/sources/hello/
+testit rsync://cvs.savannah.gnu.org/sources/hello/
+testit rsync://cvs.savannah.nongnu.org/sources/hello/
+
+exit 0
diff --git a/test/cvs-ssh b/test/cvs-ssh
new file mode 100755
index 0000000..1bfed55
--- /dev/null
+++ b/test/cvs-ssh
@@ -0,0 +1,62 @@
+#!/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
+
+HOME=$tmpdir
+mkdir "$tmpdir/.ssh"
+cat > "$tmpdir/.ssh/config" <<EOF
+Host *
+ ServerAliveInterval 200
+ HashKnownHosts no
+ CheckHostIP no
+ StrictHostKeyChecking no
+ UserKnownHostsFile /dev/null
+ BatchMode yes
+EOF
+
+testit() {
+ url=$1 ; shift
+ base=$(basename "$url")
+ cvs -z3 -d"$url" co "$base"
+ if [ $? -ne 0 ]; then
+ echo "Failed to cvs branch $url"
+ exit 1
+ fi
+ test -d "$base" || exit 1
+ rm -rf "$base"
+ test -d "$base" && exit 1
+}
+
+list="
+:ext:$USER@cvs.savannah.gnu.org:/cvsroot/hello
+:ext:$USER@cvs.savannah.gnu.org:/sources/hello
+:ext:$USER@cvs.savannah.gnu.org:/srv/cvs/sources/hello
+:ext:$USER@cvs.savannah.gnu.org:/srv/cvs/web/hello
+:ext:$USER@cvs.savannah.gnu.org:/web/hello
+:ext:$USER@cvs.savannah.gnu.org:/webcvs/hello
+"
+for url in $list; do
+ testit "$url"
+done
+
+exit 0
diff --git a/test/cvs-web b/test/cvs-web
new file mode 100755
index 0000000..1a44b27
--- /dev/null
+++ b/test/cvs-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="
+//cvs.savannah.gnu.org/
+//cvs.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
+ fail=false
+ wget -Oout "$url"
+ 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://cvs.savannah.gnu.org/robots.txt
+testrobots http://cvs.savannah.gnu.org/robots.txt
+
+exit 0