Use the port assigner for the web port config as well

This commit is contained in:
Jean-Paul Calderone 2019-03-28 15:02:14 -04:00
parent 7c97503687
commit 2898b2477b

View File

@ -457,10 +457,11 @@ class SystemTestMixin(pollmixin.PollMixin, testutil.StallMixin):
""" """
iv_dir = self.getdir("introducer") iv_dir = self.getdir("introducer")
if not os.path.isdir(iv_dir): if not os.path.isdir(iv_dir):
_, port_endpoint = self.port_assigner.assign(reactor)
introducer_config = ( introducer_config = (
u"[node]\n" u"[node]\n"
u"nickname = introducer \N{BLACK SMILING FACE}\n" u"nickname = introducer \N{BLACK SMILING FACE}\n" +
u"web.port = tcp:0:interface=127.0.0.1\n" u"web.port = {}\n".format(port_endpoint)
).encode("utf-8") ).encode("utf-8")
fileutil.make_dirs(iv_dir) fileutil.make_dirs(iv_dir)
@ -616,7 +617,8 @@ class SystemTestMixin(pollmixin.PollMixin, testutil.StallMixin):
setnode("tub.port", tub_port_endpoint) setnode("tub.port", tub_port_endpoint)
setnode("tub.location", tub_location_hint) setnode("tub.location", tub_location_hint)
setnode("web.port", "tcp:0:interface=127.0.0.1") _, web_port_endpoint = self.port_assigner.assign(reactor)
setnode("web.port", web_port_endpoint)
setnode("timeout.keepalive", "600") setnode("timeout.keepalive", "600")
setnode("timeout.disconnect", "1800") setnode("timeout.disconnect", "1800")