Enable boulder tests on Python 3

This commit is contained in:
Yen Chi Hsuan
2017-04-15 02:32:18 +08:00
parent f54280d9b9
commit 29d25f0915
4 changed files with 40 additions and 7 deletions
+24 -4
View File
@@ -78,13 +78,33 @@ matrix:
env: TOXENV=apacheconftest env: TOXENV=apacheconftest
sudo: required sudo: required
- python: "3.3" - python: "3.3"
env: TOXENV=py33 env: TOXENV=py33 BOULDER_INTEGRATION=1
sudo: required
after_failure:
- sudo cat /var/log/mysql/error.log
- ps aux | grep mysql
services: docker
- python: "3.4" - python: "3.4"
env: TOXENV=py34 env: TOXENV=py34 BOULDER_INTEGRATION=1
sudo: required
after_failure:
- sudo cat /var/log/mysql/error.log
- ps aux | grep mysql
services: docker
- python: "3.5" - python: "3.5"
env: TOXENV=py35 env: TOXENV=py35 BOULDER_INTEGRATION=1
sudo: required
after_failure:
- sudo cat /var/log/mysql/error.log
- ps aux | grep mysql
services: docker
- python: "3.6" - python: "3.6"
env: TOXENV=py36 env: TOXENV=py36 BOULDER_INTEGRATION=1
sudo: required
after_failure:
- sudo cat /var/log/mysql/error.log
- ps aux | grep mysql
services: docker
- python: "2.7" - python: "2.7"
env: TOXENV=nginxroundtrip env: TOXENV=nginxroundtrip
+2 -2
View File
@@ -82,7 +82,7 @@ CheckHooks() {
# We start a server listening on the port for the # We start a server listening on the port for the
# unrequested challenge to prevent regressions in #3601. # unrequested challenge to prevent regressions in #3601.
python -m SimpleHTTPServer $http_01_port & python ./tests/run_http_server.py $http_01_port &
python_server_pid=$! python_server_pid=$!
common --domains le1.wtf --preferred-challenges tls-sni-01 auth \ common --domains le1.wtf --preferred-challenges tls-sni-01 auth \
@@ -90,7 +90,7 @@ common --domains le1.wtf --preferred-challenges tls-sni-01 auth \
--post-hook 'echo wtf.post >> "$HOOK_TEST"'\ --post-hook 'echo wtf.post >> "$HOOK_TEST"'\
--renew-hook 'echo renew >> "$HOOK_TEST"' --renew-hook 'echo renew >> "$HOOK_TEST"'
kill $python_server_pid kill $python_server_pid
python -m SimpleHTTPServer $tls_sni_01_port & python ./tests/run_http_server.py $tls_sni_01_port &
python_server_pid=$! python_server_pid=$!
common --domains le2.wtf --preferred-challenges http-01 run \ common --domains le2.wtf --preferred-challenges http-01 run \
--pre-hook 'echo wtf.pre >> "$HOOK_TEST"' \ --pre-hook 'echo wtf.pre >> "$HOOK_TEST"' \
+3 -1
View File
@@ -1,10 +1,12 @@
#!/bin/sh #!/bin/sh
uri_path=".well-known/acme-challenge/$CERTBOT_TOKEN" uri_path=".well-known/acme-challenge/$CERTBOT_TOKEN"
# This script should be run from the top level. e.g. ./tests/manual-http-auth.sh
source_dir="$(pwd)"
cd $(mktemp -d) cd $(mktemp -d)
mkdir -p $(dirname $uri_path) mkdir -p $(dirname $uri_path)
echo $CERTBOT_VALIDATION > $uri_path echo $CERTBOT_VALIDATION > $uri_path
python -m SimpleHTTPServer $http_01_port >/dev/null 2>&1 & python "$source_dir/tests/run_http_server.py" $http_01_port >/dev/null 2>&1 &
server_pid=$! server_pid=$!
while ! curl "http://localhost:$http_01_port/$uri_path" >/dev/null 2>&1; do while ! curl "http://localhost:$http_01_port/$uri_path" >/dev/null 2>&1; do
sleep 1s sleep 1s
+11
View File
@@ -0,0 +1,11 @@
import runpy
import sys
# Run Python's built-in HTTP server
# Usage: python ./tests/run_http_server.py port_num
# NOTE: This script should be compatible with 2.6, 2.7, 3.3+
# sys.argv (port number) is passed as-is to the HTTP server module
runpy.run_module(
'http.server' if sys.version_info[0] == 3 else 'SimpleHTTPServer',
run_name='__main__')