Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion start.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if not startservers.install(race_detection=False):
raise(Exception("failed to build"))

if not startservers.start(fakeclock=None):
if not startservers.start():
sys.exit(1)
try:
os.wait()
Expand Down
23 changes: 0 additions & 23 deletions test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,29 +154,6 @@ def verify_akamai_purge():
break
reset_akamai_purges()

twenty_days_ago_functions = [ ]

def register_twenty_days_ago(f):
"""Register a function to be run during "setup_twenty_days_ago." This allows
test cases to define their own custom setup.
"""
twenty_days_ago_functions.append(f)

def setup_twenty_days_ago():
"""Do any setup that needs to happen 20 day in the past, for tests that
will run in the 'present'.
"""
for f in twenty_days_ago_functions:
f()

six_months_ago_functions = []

def register_six_months_ago(f):
six_months_ago_functions.append(f)

def setup_six_months_ago():
[f() for f in six_months_ago_functions]

def waitport(port, prog, perTickCheck=None):
"""Wait until a port on localhost is open."""
for _ in range(1000):
Expand Down
17 changes: 1 addition & 16 deletions test/integration-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,7 @@ def main():
if not startservers.install(race_detection=race_detection):
raise(Exception("failed to build"))

if not args.test_case_filter:
now = datetime.datetime.utcnow()

six_months_ago = now+datetime.timedelta(days=-30*6)
if not startservers.start(fakeclock=fakeclock(six_months_ago)):
raise(Exception("startservers failed (mocking six months ago)"))
setup_six_months_ago()
startservers.stop()

twenty_days_ago = now+datetime.timedelta(days=-20)
if not startservers.start(fakeclock=fakeclock(twenty_days_ago)):
raise(Exception("startservers failed (mocking twenty days ago)"))
setup_twenty_days_ago()
startservers.stop()

if not startservers.start(fakeclock=None):
if not startservers.start():
raise(Exception("startservers failed"))

if args.run_chisel:
Expand Down
11 changes: 4 additions & 7 deletions test/startservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,14 @@ def install(race_detection):

return subprocess.call(["/usr/bin/make", "GO_BUILD_FLAGS=%s" % go_build_flags]) == 0

def run(cmd, fakeclock):
def run(cmd):
e = os.environ.copy()
e.setdefault("GORACE", "halt_on_error=1")
if fakeclock:
e.setdefault("FAKECLOCK", fakeclock)
p = subprocess.Popen(cmd, env=e)
p.cmd = cmd
return p

def start(fakeclock):
def start():
"""Return True if everything builds and starts.

Give up and return False if anything fails to build, or dies at
Expand Down Expand Up @@ -229,7 +227,7 @@ def start(fakeclock):
print("Starting service", service.name)
try:
global processes
p = run(service.cmd, fakeclock)
p = run(service.cmd)
processes.append(p)
if service.grpc_port is not None:
waithealth(' '.join(p.args), service.grpc_port, service.host_override)
Expand Down Expand Up @@ -289,8 +287,7 @@ def startChallSrv():
'--management', ':8055',
'--http01', '64.112.117.122:80',
'-https01', '64.112.117.122:443',
'--tlsalpn01', '64.112.117.134:443'],
None)
'--tlsalpn01', '64.112.117.134:443'])
# Wait for the chall-test-srv management port.
if not waitport(8055, ' '.join(challSrvProcess.args)):
return False
Expand Down