forked from certbot/certbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request certbot#1992 from letsencrypt/apache-conf-test
Apache conf tests in travis
- Loading branch information
Showing
31 changed files
with
112 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
78 changes: 78 additions & 0 deletions
78
letsencrypt-apache/letsencrypt_apache/tests/apache-conf-files/apache-conf-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
# A hackish script to see if the client is behaving as expected | ||
# with each of the "passing" conf files. | ||
|
||
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... | ||
if [ "$f" != "" ] ; then | ||
Cleanup | ||
fi | ||
exit 1 | ||
} | ||
|
||
function Setup() { | ||
if [ "$APPEND_APACHECONF" = "" ] ; then | ||
sudo cp "$f" "$EA"/sites-available/ | ||
sudo ln -sf "$EA/sites-available/$f" "$EA/sites-enabled/$f" | ||
sudo echo """ | ||
<VirtualHost *:80> | ||
ServerName example.com | ||
DocumentRoot /tmp/ | ||
ErrorLog /tmp/error.log | ||
CustomLog /tmp/requests.log combined | ||
</VirtualHost>""" >> $EA/sites-available/throwaway-example.conf | ||
else | ||
TMP="/tmp/`basename \"$APPEND_APACHECONF\"`.$$" | ||
sudo cp -a "$APPEND_APACHECONF" "$TMP" | ||
sudo bash -c "cat \"$f\" >> \"$APPEND_APACHECONF\"" | ||
fi | ||
} | ||
|
||
function Cleanup() { | ||
if [ "$APPEND_APACHECONF" = "" ] ; then | ||
sudo rm /etc/apache2/sites-{enabled,available}/"$f" | ||
sudo rm $EA/sites-available/throwaway-example.conf | ||
else | ||
sudo mv "$TMP" "$APPEND_APACHECONF" | ||
fi | ||
} | ||
|
||
# if our environment asks us to enable modules, do our best! | ||
if [ "$1" = --debian-modules ] ; then | ||
sudo apt-get install -y libapache2-mod-wsgi | ||
sudo apt-get install -y libapache2-mod-macro | ||
|
||
for mod in ssl rewrite macro wsgi deflate userdir version mime ; do | ||
sudo a2enmod $mod | ||
done | ||
fi | ||
|
||
|
||
FAILS=0 | ||
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` | ||
if echo $RESULT | grep -Eq \("Which names would you like"\|"mod_macro is not yet"\) ; then | ||
echo passed | ||
else | ||
echo failed | ||
echo $RESULT | ||
echo | ||
echo | ||
FAILS=`expr $FAILS + 1` | ||
fi | ||
Cleanup | ||
done | ||
if [ "$FAILS" -ne 0 ] ; then | ||
exit 1 | ||
fi | ||
exit 0 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
letsencrypt-apache/letsencrypt_apache/tests/apache-conf-files/passing/README.modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Modules required to parse these conf files: | ||
ssl | ||
rewrite | ||
macro | ||
wsgi | ||
deflate |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...nf-files/passing/graphite-quote-1934.conf → ...nf-files/passing/graphite-quote-1934.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters