mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 13:59:02 -04:00
Refactor integration scripts, use --debug.
This commit is contained in:
parent
98844a196c
commit
096920b8b3
5 changed files with 57 additions and 66 deletions
|
|
@ -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!
|
||||
|
||||
root="$(mktemp -d)"
|
||||
echo "\nRoot integration tests directory: $root"
|
||||
store_flags="--config-dir $root/conf --work-dir $root/work"
|
||||
store_flags="$store_flags --logs-dir $root/logs"
|
||||
|
||||
. ./tests/integration/_common.sh
|
||||
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
|
||||
|
||||
|
||||
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 "" \
|
||||
letsencrypt_test \
|
||||
--authenticator standalone \
|
||||
--installer null \
|
||||
-vvvvvvv "$@"
|
||||
"$@"
|
||||
}
|
||||
|
||||
common --domains le1.wtf auth
|
||||
|
|
@ -67,5 +55,5 @@ done
|
|||
|
||||
if type nginx;
|
||||
then
|
||||
. ./tests/boulder-integration-nginx.sh
|
||||
. ./tests/integration/nginx.sh
|
||||
fi
|
||||
|
|
|
|||
25
tests/integration/_common.sh
Executable file
25
tests/integration/_common.sh
Executable file
|
|
@ -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 \
|
||||
"$@"
|
||||
}
|
||||
28
tests/integration/nginx.sh
Executable file
28
tests/integration/nginx.sh
Executable file
|
|
@ -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
|
||||
Loading…
Reference in a new issue