2015-06-27 09:34:23 -04:00
|
|
|
#!/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
|
2017-06-21 16:49:15 -04:00
|
|
|
original=$(root="$nginx_root" ./certbot-nginx/tests/boulder-integration.conf.sh)
|
|
|
|
|
nginx_conf="$nginx_root/nginx.conf"
|
|
|
|
|
echo "$original" > $nginx_conf
|
|
|
|
|
|
2015-06-27 09:34:23 -04:00
|
|
|
|
|
|
|
|
killall nginx || true
|
|
|
|
|
nginx -c $nginx_root/nginx.conf
|
|
|
|
|
|
2016-04-13 19:45:54 -04:00
|
|
|
certbot_test_nginx () {
|
|
|
|
|
certbot_test \
|
2017-06-21 16:49:15 -04:00
|
|
|
--authenticator nginx \
|
|
|
|
|
--installer nginx \
|
2015-06-27 09:34:23 -04:00
|
|
|
--nginx-server-root $nginx_root \
|
|
|
|
|
"$@"
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-13 19:45:54 -04:00
|
|
|
certbot_test_nginx --domains nginx.wtf run
|
2015-06-27 09:34:23 -04:00
|
|
|
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
|
|
|
|
|
|
2017-06-21 16:49:15 -04:00
|
|
|
certbot_test_nginx rollback --checkpoints 9001
|
|
|
|
|
diff -q <(echo "$original") $nginx_conf
|
|
|
|
|
|
2015-06-27 09:34:23 -04:00
|
|
|
# note: not reached if anything above fails, hence "killall" at the
|
|
|
|
|
# top
|
|
|
|
|
nginx -c $nginx_root/nginx.conf -s stop
|