summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Proulx <bob@proulx.com>2017-01-11 23:33:02 (GMT)
committerBob Proulx <bob@proulx.com>2017-01-11 23:34:28 (GMT)
commit252fbaaf58ec391669186bb806535e0aeae63ea3 (patch)
treea9b8bf9a56d06ad1873d2a464fff4354a83f28a3
parent30a8706eaf94cb6eaed3920201cbd9675b9a03a6 (diff)
downloadsavannah-tests-252fbaaf58ec391669186bb806535e0aeae63ea3.zip
savannah-tests-252fbaaf58ec391669186bb806535e0aeae63ea3.tar.gz
savannah-tests-252fbaaf58ec391669186bb806535e0aeae63ea3.tar.bz2
git update web/http/https
-rwxr-xr-xtest/git-http70
-rwxr-xr-xtest/git-https38
-rwxr-xr-xtest/git-web117
3 files changed, 151 insertions, 74 deletions
diff --git a/test/git-http b/test/git-http
index cfff16a..6715264 100755
--- a/test/git-http
+++ b/test/git-http
@@ -24,70 +24,32 @@ cd "$tmpdir" || exit 1
testit() {
url=$1 ; shift
- wget -Oout "$url"
- if [ $? -ne 0 ]; then
- echo "Failed to web GET: $url"
- exit 1
+ if [ $# -ge 1 ]; then
+ args=$1 ; shift
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"
+ git clone $args "$url"
+ if [ $? -ne 0 ]; then
+ echo "Failed to git clone $args $url"
exit 1
fi
- test -s out && exit 1
- echo "XFAIL: $url"
+ base=$(basename "$url" .git)
+ test -d "$base" || exit 1
+ rm -rf "$base"
+ test -d "$base" && exit 1
}
list="
-//git.savannah.gnu.org/
-//git.savannah.gnu.org/cgit/
-//git.savannah.gnu.org/gitweb/
+//git.savannah.gnu.org/git/
//git.savannah.gnu.org/r/
+//git.savannah.nongnu.org/git/
+//git.savannah.nongnu.org/r/
+//git.sv.gnu.org/git/
+//git.sv.gnu.org/r/
+//git.sv.nongnu.org/git/
+//git.sv.nongnu.org/r/
"
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
-}
-
-testrobotsxfail() {
- 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
-}
-
-testrobotsxfail https://git.savannah.gnu.org/robots.txt
-testrobots http://git.savannah.gnu.org/robots.txt
-
exit 0
diff --git a/test/git-https b/test/git-https
index 02e34e2..c2bc660 100755
--- a/test/git-https
+++ b/test/git-https
@@ -24,36 +24,34 @@ cd "$tmpdir" || exit 1
testit() {
url=$1 ; shift
- wget -Oout "$url"
- if [ $? -ne 0 ]; then
- echo "Failed to web GET: $url"
- exit 1
+ if [ $# -ge 1 ]; then
+ args=$1 ; shift
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"
+ git clone $args "$url"
+ if [ $? -ne 0 ]; then
+ echo "Failed to git clone $args $url"
exit 1
fi
- test -s out && exit 1
- echo "XFAIL: $url"
+ base=$(basename "$url" .git)
+ test -d "$base" || exit 1
+ rm -rf "$base"
+ test -d "$base" && exit 1
}
list="
-//git.savannah.gnu.org/
-//git.savannah.gnu.org/robots.txt
-//git.savannah.gnu.org/cgit/
-//git.savannah.gnu.org/gitweb/
+//git.savannah.gnu.org/git/
//git.savannah.gnu.org/r/
+//git.savannah.nongnu.org/git/
+//git.savannah.nongnu.org/r/
+//git.sv.gnu.org/git/
+//git.sv.gnu.org/r/
+//git.sv.nongnu.org/git/
+//git.sv.nongnu.org/r/
"
for url in $list; do
testit "https:$url"
done
exit 0
+
+exit 0
diff --git a/test/git-web b/test/git-web
new file mode 100755
index 0000000..b538c37
--- /dev/null
+++ b/test/git-web
@@ -0,0 +1,117 @@
+#!/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="
+//git.savannah.gnu.org/
+//git.savannah.gnu.org/cgit/
+//git.savannah.gnu.org/gitweb/
+//git.savannah.gnu.org/r/
+//git.savannah.nongnu.org/
+//git.savannah.nongnu.org/cgit/
+//git.savannah.nongnu.org/gitweb/
+//git.savannah.nongnu.org/r/
+//git.sv.gnu.org/
+//git.sv.gnu.org/cgit/
+//git.sv.gnu.org/gitweb/
+//git.sv.gnu.org/r/
+//git.sv.nongnu.org/
+//git.sv.nongnu.org/cgit/
+//git.sv.nongnu.org/gitweb/
+//git.sv.nongnu.org/r/
+"
+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
+}
+
+testrobotsxfail() {
+ 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
+}
+
+testrobotsxfail https://git.savannah.gnu.org/robots.txt
+testrobotsxfail https://git.savannah.nongnu.org/robots.txt
+
+testrobots http://git.savannah.gnu.org/robots.txt
+testrobots http://git.savannah.nongnu.org/robots.txt
+
+testrobotsxfail https://git.sv.gnu.org/robots.txt
+testrobotsxfail https://git.sv.nongnu.org/robots.txt
+
+testrobots http://git.sv.gnu.org/robots.txt
+testrobots http://git.sv.nongnu.org/robots.txt
+
+exit 0