Skip to content

Commit

Permalink
apacheconf: sane sudo letsencrypt (fixes certbot#2800)
Browse files Browse the repository at this point in the history
- hardcoded
  `LETSENCRYPT=/home/travis/build/letsencrypt/letsencrypt/.tox/apacheconftest/bin/letsencrypt`
  causes Travis tests to fail if running under any other Travis user
  (from e.g. a fork)

- `sudo env "PATH=$PATH" letsencrypt` should make sure that sudo can
  find letsencrypt binary from virtualenv; realpath is not necessary

- sudo is called already from within the test script, no need to sudo
  the entire script
  • Loading branch information
kuba committed Apr 10, 2016
1 parent b347e9f commit df2baae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ addons:
# For Boulder integration testing
- rsyslog
# for apacheconftest
#- realpath
#- apache2
#- libapache2-mod-wsgi
#- libapache2-mod-macro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

export EA=/etc/apache2/
TESTDIR="`dirname $0`"
LEROOT="`realpath \"$TESTDIR/../../../../\"`"
cd $TESTDIR/passing
LETSENCRYPT="${LETSENCRYPT:-$LEROOT/venv/bin/letsencrypt}"

function CleanupExit() {
echo control c, exiting tests...
Expand Down Expand Up @@ -61,7 +59,7 @@ trap CleanupExit INT
for f in *.conf ; do
echo -n testing "$f"...
Setup
RESULT=`echo c | sudo "$LETSENCRYPT" -vvvv --debug --staging --apache --register-unsafely-without-email --agree-tos certonly -t 2>&1`
RESULT=`echo c | sudo env "PATH=$PATH" letsencrypt -vvvv --debug --staging --apache --register-unsafely-without-email --agree-tos certonly -t 2>&1`
if echo $RESULT | grep -Eq \("Which names would you like"\|"mod_macro is not yet"\) ; then
echo passed
else
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ commands =

[testenv:apacheconftest]
#basepython = python2.7
setenv =
LETSENCRYPT=/home/travis/build/letsencrypt/letsencrypt/.tox/apacheconftest/bin/letsencrypt
commands =
pip install -e acme -e .[dev] -e letsencrypt-apache -e letsencrypt-nginx -e letsencrypt-compatibility-test -e letshelp-letsencrypt
sudo ./letsencrypt-apache/letsencrypt_apache/tests/apache-conf-files/apache-conf-test --debian-modules
./letsencrypt-apache/letsencrypt_apache/tests/apache-conf-files/apache-conf-test --debian-modules

[testenv:le_auto]
# At the moment, this tests under Python 2.7 only, as only that version is
Expand Down

0 comments on commit df2baae

Please sign in to comment.