mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:14:54 +02:00
Enable boulder tests on Python 3
This commit is contained in:
@@ -82,7 +82,7 @@ CheckHooks() {
|
||||
|
||||
# We start a server listening on the port for the
|
||||
# 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=$!
|
||||
|
||||
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"'\
|
||||
--renew-hook 'echo renew >> "$HOOK_TEST"'
|
||||
kill $python_server_pid
|
||||
python -m SimpleHTTPServer $tls_sni_01_port &
|
||||
python ./tests/run_http_server.py $tls_sni_01_port &
|
||||
python_server_pid=$!
|
||||
common --domains le2.wtf --preferred-challenges http-01 run \
|
||||
--pre-hook 'echo wtf.pre >> "$HOOK_TEST"' \
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#!/bin/sh
|
||||
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)
|
||||
mkdir -p $(dirname $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=$!
|
||||
while ! curl "http://localhost:$http_01_port/$uri_path" >/dev/null 2>&1; do
|
||||
sleep 1s
|
||||
|
||||
@@ -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__')
|
||||
Reference in New Issue
Block a user