From 4b04cfd88cb1628589ed73f86f5731e6faf28707 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Mon, 7 Jan 2019 16:31:48 -0800 Subject: [PATCH] Rename ACME_SERVER_URI and add default. --- .travis.yml | 1 - .../tests/apache-conf-files/apache-conf-test | 8 +++++--- tests/letstest/scripts/test_apache2.sh | 2 +- tox.ini | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37ddb9e68..065de6533 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,6 @@ matrix: addons: - python: "2.7" env: - - ACME_SERVER_URI="http://localhost:4000/directory" - BOULDER_FOR_TOX=1 - TOXENV=apacheconftest sudo: required diff --git a/certbot-apache/certbot_apache/tests/apache-conf-files/apache-conf-test b/certbot-apache/certbot_apache/tests/apache-conf-files/apache-conf-test index 5d273a498..1da2d5d26 100755 --- a/certbot-apache/certbot_apache/tests/apache-conf-files/apache-conf-test +++ b/certbot-apache/certbot_apache/tests/apache-conf-files/apache-conf-test @@ -3,8 +3,10 @@ # A hackish script to see if the client is behaving as expected # with each of the "passing" conf files. -if [ -z "$ACME_SERVER_URI" ]; then - echo Please set ACME_SERVER_URI. +SERVER="${SERVER:-http://localhost:4000/directory}" +if ! curl "$SERVER" >/dev/null 2>&1; then + echo "ACME server not found." + echo "Please set SERVER to the ACME server's directory URL." exit 1 fi @@ -61,7 +63,7 @@ if [ "$1" = --debian-modules ] ; then done fi -CERTBOT_CMD="sudo $(command -v certbot) --server $ACME_SERVER_URI -vvvv" +CERTBOT_CMD="sudo $(command -v certbot) --server $SERVER -vvvv" CERTBOT_CMD="$CERTBOT_CMD --debug --apache --register-unsafely-without-email" CERTBOT_CMD="$CERTBOT_CMD --agree-tos certonly -t" diff --git a/tests/letstest/scripts/test_apache2.sh b/tests/letstest/scripts/test_apache2.sh index be8d8d2bc..d24de2458 100755 --- a/tests/letstest/scripts/test_apache2.sh +++ b/tests/letstest/scripts/test_apache2.sh @@ -54,7 +54,7 @@ if [ $? -ne 0 ] ; then fi if [ "$OS_TYPE" = "ubuntu" ] ; then - export ACME_SERVER_URI="$BOULDER_URL" + export SERVER="$BOULDER_URL" venv/bin/tox -e apacheconftest else echo Not running hackish apache tests on $OS_TYPE diff --git a/tox.ini b/tox.ini index 563cd65fb..6a516a524 100644 --- a/tox.ini +++ b/tox.ini @@ -156,7 +156,7 @@ commands = {[base]pip_install} acme . certbot-apache certbot-compatibility-test {toxinidir}/certbot-apache/certbot_apache/tests/apache-conf-files/apache-conf-test --debian-modules passenv = - ACME_SERVER_URI + SERVER [testenv:nginxroundtrip] commands =