mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:44:21 +02:00
Refactor integration scripts, use --debug.
This commit is contained in:
@@ -1,50 +0,0 @@
|
|||||||
#!/bin/sh -xe
|
|
||||||
|
|
||||||
# prerequisite: apt-get install --no-install-recommends nginx-light openssl
|
|
||||||
|
|
||||||
if [ "xxx$root" = "xxx" ];
|
|
||||||
then
|
|
||||||
root="$(mktemp -d)"
|
|
||||||
fi
|
|
||||||
export root
|
|
||||||
|
|
||||||
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
|
|
||||||
|
|
||||||
echo "\nRoot integration tests directory: $root"
|
|
||||||
store_flags="--config-dir $root/conf --work-dir $root/work"
|
|
||||||
store_flags="$store_flags --logs-dir $root/logs"
|
|
||||||
|
|
||||||
nginx_root="$root/nginx"
|
|
||||||
mkdir $nginx_root
|
|
||||||
root="$nginx_root" ./tests/nginx.conf.sh > $nginx_root/nginx.conf
|
|
||||||
|
|
||||||
killall nginx || true
|
|
||||||
nginx -c $nginx_root/nginx.conf
|
|
||||||
|
|
||||||
common() {
|
|
||||||
# first three flags required, rest is handy defaults
|
|
||||||
letsencrypt \
|
|
||||||
--server "${SERVER:-http://localhost:4000/acme/new-reg}" \
|
|
||||||
--no-verify-ssl \
|
|
||||||
--dvsni-port 5001 \
|
|
||||||
$store_flags \
|
|
||||||
--text \
|
|
||||||
--agree-eula \
|
|
||||||
--email "" \
|
|
||||||
-vvvvvvv "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
test_nginx() {
|
|
||||||
common --configurator nginx \
|
|
||||||
--nginx-server-root $nginx_root \
|
|
||||||
"$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
test_nginx --domains nginx.wtf run
|
|
||||||
echo | openssl s_client -connect localhost:5001 \
|
|
||||||
| openssl x509 -out $root/nginx.pem
|
|
||||||
diff -q $root/nginx.pem $root/conf/live/nginx.wtf/cert.pem
|
|
||||||
|
|
||||||
# note: not reached if anything above fails, hence "killall" at the
|
|
||||||
# top
|
|
||||||
nginx -c $nginx_root/nginx.conf -s stop
|
|
||||||
@@ -10,27 +10,15 @@
|
|||||||
#
|
#
|
||||||
# Note: this script is called by Boulder integration test suite!
|
# Note: this script is called by Boulder integration test suite!
|
||||||
|
|
||||||
root="$(mktemp -d)"
|
. ./tests/integration/_common.sh
|
||||||
echo "\nRoot integration tests directory: $root"
|
|
||||||
store_flags="--config-dir $root/conf --work-dir $root/work"
|
|
||||||
store_flags="$store_flags --logs-dir $root/logs"
|
|
||||||
|
|
||||||
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
|
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
|
||||||
|
|
||||||
|
|
||||||
common() {
|
common() {
|
||||||
# first three flags required, rest is handy defaults
|
letsencrypt_test \
|
||||||
letsencrypt \
|
|
||||||
--server "${SERVER:-http://localhost:4000/acme/new-reg}" \
|
|
||||||
--no-verify-ssl \
|
|
||||||
--dvsni-port 5001 \
|
|
||||||
$store_flags \
|
|
||||||
--text \
|
|
||||||
--agree-eula \
|
|
||||||
--email "" \
|
|
||||||
--authenticator standalone \
|
--authenticator standalone \
|
||||||
--installer null \
|
--installer null \
|
||||||
-vvvvvvv "$@"
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
common --domains le1.wtf auth
|
common --domains le1.wtf auth
|
||||||
@@ -67,5 +55,5 @@ done
|
|||||||
|
|
||||||
if type nginx;
|
if type nginx;
|
||||||
then
|
then
|
||||||
. ./tests/boulder-integration-nginx.sh
|
. ./tests/integration/nginx.sh
|
||||||
fi
|
fi
|
||||||
|
|||||||
Executable
+25
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "xxx$root" = "xxx" ];
|
||||||
|
then
|
||||||
|
root="$(mktemp -d)"
|
||||||
|
echo "Root integration tests directory: $root"
|
||||||
|
fi
|
||||||
|
store_flags="--config-dir $root/conf --work-dir $root/work"
|
||||||
|
store_flags="$store_flags --logs-dir $root/logs"
|
||||||
|
export root store_flags
|
||||||
|
|
||||||
|
letsencrypt_test () {
|
||||||
|
# first three flags required, rest is handy defaults
|
||||||
|
letsencrypt \
|
||||||
|
--server "${SERVER:-http://localhost:4000/acme/new-reg}" \
|
||||||
|
--no-verify-ssl \
|
||||||
|
--dvsni-port 5001 \
|
||||||
|
$store_flags \
|
||||||
|
--text \
|
||||||
|
--agree-eula \
|
||||||
|
--email "" \
|
||||||
|
--debug \
|
||||||
|
-vvvvvvv \
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
Executable
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh -xe
|
||||||
|
# prerequisite: apt-get install --no-install-recommends nginx-light openssl
|
||||||
|
|
||||||
|
. ./tests/integration/_common.sh
|
||||||
|
|
||||||
|
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
|
||||||
|
nginx_root="$root/nginx"
|
||||||
|
mkdir $nginx_root
|
||||||
|
root="$nginx_root" ./tests/integration/nginx.conf.sh > $nginx_root/nginx.conf
|
||||||
|
|
||||||
|
killall nginx || true
|
||||||
|
nginx -c $nginx_root/nginx.conf
|
||||||
|
|
||||||
|
letsencrypt_test_nginx () {
|
||||||
|
letsencrypt_test \
|
||||||
|
--configurator nginx \
|
||||||
|
--nginx-server-root $nginx_root \
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
letsencrypt_test_nginx --domains nginx.wtf run
|
||||||
|
echo | openssl s_client -connect localhost:5001 \
|
||||||
|
| openssl x509 -out $root/nginx.pem
|
||||||
|
diff -q $root/nginx.pem $root/conf/live/nginx.wtf/cert.pem
|
||||||
|
|
||||||
|
# note: not reached if anything above fails, hence "killall" at the
|
||||||
|
# top
|
||||||
|
nginx -c $nginx_root/nginx.conf -s stop
|
||||||
Reference in New Issue
Block a user