From 88e9e595a31bd5aecd7a0a65b254c57d58773c4c Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Thu, 11 Jan 2018 15:23:24 -0800 Subject: [PATCH] add nginx integration test --- .../tests/boulder-integration.conf.sh | 6 +++--- certbot-nginx/tests/boulder-integration.sh | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/certbot-nginx/tests/boulder-integration.conf.sh b/certbot-nginx/tests/boulder-integration.conf.sh index 5295e3681..c38180698 100755 --- a/certbot-nginx/tests/boulder-integration.conf.sh +++ b/certbot-nginx/tests/boulder-integration.conf.sh @@ -49,10 +49,10 @@ http { server { # IPv4. - listen 8081; + listen 5002; # IPv6. - listen [::]:8081 default ipv6only=on; - server_name nginx.wtf; + listen [::]:5002 default ipv6only=on; + server_name nginx.wtf nginx2.wtf; root $root/webroot; diff --git a/certbot-nginx/tests/boulder-integration.sh b/certbot-nginx/tests/boulder-integration.sh index 996cc2201..f236fb103 100755 --- a/certbot-nginx/tests/boulder-integration.sh +++ b/certbot-nginx/tests/boulder-integration.sh @@ -22,13 +22,20 @@ certbot_test_nginx () { "$@" } -certbot_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 +test_deployment_and_rollback() { + # Arguments: certname + echo | openssl s_client -connect localhost:5001 \ + | openssl x509 -out $root/nginx.pem + diff -q $root/nginx.pem "$root/conf/live/$1/cert.pem" -certbot_test_nginx rollback --checkpoints 9001 -diff -q <(echo "$original") $nginx_conf + certbot_test_nginx rollback --checkpoints 9001 + diff -q <(echo "$original") $nginx_conf +} + +certbot_test_nginx --domains nginx.wtf run +test_deployment_and_rollback nginx.wtf +certbot_test_nginx --domains nginx2.wtf --preferred-challenges http +test_deployment_and_rollback nginx2.wtf # note: not reached if anything above fails, hence "killall" at the # top