Bring up a stub ToS server in test scripts.
This commit is contained in:
parent
e871b30cbf
commit
e6ca449d34
|
|
@ -172,5 +172,5 @@
|
||||||
"dnsTimeout": "10s"
|
"dnsTimeout": "10s"
|
||||||
},
|
},
|
||||||
|
|
||||||
"subscriberAgreementURL": "http://localhost:4000/directory"
|
"subscriberAgreementURL": "http://localhost:4001/terms/v1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,21 @@
|
||||||
import atexit
|
import atexit
|
||||||
|
import BaseHTTPServer
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import signal
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import threading
|
||||||
|
|
||||||
|
|
||||||
|
class ToSServerThread(threading.Thread):
|
||||||
|
class ToSHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||||
|
def do_GET(self):
|
||||||
|
self.send_response(200)
|
||||||
|
self.end_headers()
|
||||||
|
self.wfile.write("Do What Ye Will (An it Harm None).\n")
|
||||||
|
def run(self):
|
||||||
|
BaseHTTPServer.HTTPServer(("localhost", 4001), self.ToSHandler).serve_forever()
|
||||||
|
|
||||||
|
|
||||||
config = os.environ.get('BOULDER_CONFIG')
|
config = os.environ.get('BOULDER_CONFIG')
|
||||||
|
|
@ -35,6 +47,7 @@ def start():
|
||||||
up explicitly by calling stop(), or automatically atexit.
|
up explicitly by calling stop(), or automatically atexit.
|
||||||
"""
|
"""
|
||||||
global processes
|
global processes
|
||||||
|
ToSServerThread().start()
|
||||||
for prog in [
|
for prog in [
|
||||||
'cmd/boulder-wfe',
|
'cmd/boulder-wfe',
|
||||||
'cmd/boulder-ra',
|
'cmd/boulder-ra',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue