apacheconf: sane sudo letsencrypt (fixes #2800)

- 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
This commit is contained in:
Jakub Warmuz 2016-04-10 17:57:08 +00:00
parent b347e9fba1
commit df2baae476
No known key found for this signature in database
GPG key ID: 3E044BCC824E2C0B
3 changed files with 2 additions and 7 deletions

View file

@ -110,7 +110,6 @@ addons:
# For Boulder integration testing
- rsyslog
# for apacheconftest
#- realpath
#- apache2
#- libapache2-mod-wsgi
#- libapache2-mod-macro

View file

@ -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...
@ -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

View file

@ -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