Merge branch 'master' of github.com:tahoe-lafs/tahoe-lafs into 3758.refactor.web-tests-grid-logs-root

This commit is contained in:
fenn-cs 2021-08-24 16:28:46 +01:00
commit 7e2338c22c
3 changed files with 12 additions and 7 deletions

0
newsfragments/3563.minor Normal file
View File

View File

@ -793,7 +793,7 @@ def _tub_portlocation(config, get_local_addresses_sync, allocate_tcp_port):
tubport = _convert_tub_port(cfg_tubport)
for port in tubport.split(","):
if port in ("0", "tcp:0"):
if port in ("0", "tcp:0", "tcp:port=0", "tcp:0:interface=127.0.0.1"):
raise PortAssignmentRequired()
if cfg_location is None:

View File

@ -6,7 +6,7 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import PY2, native_str
from future.utils import PY2
if PY2:
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
@ -530,6 +530,14 @@ def _stub_allocate_tcp_port():
"""
return 999
def _stub_none():
"""
A function like ``_stub_allocate_tcp`` or ``_stub_get_local_addresses_sync``
but that return an empty list since ``allmydata.node._tub_portlocation`` requires a
callable for paramter 1 and 2 counting from 0.
"""
return []
class TestMissingPorts(unittest.TestCase):
"""
@ -550,7 +558,7 @@ class TestMissingPorts(unittest.TestCase):
)
config = config_from_string(self.basedir, "portnum", config_data)
with self.assertRaises(PortAssignmentRequired):
_tub_portlocation(config, None, None)
_tub_portlocation(config, _stub_none, _stub_none)
def test_listen_on_zero_with_host(self):
"""
@ -563,10 +571,7 @@ class TestMissingPorts(unittest.TestCase):
)
config = config_from_string(self.basedir, "portnum", config_data)
with self.assertRaises(PortAssignmentRequired):
_tub_portlocation(config, None, None)
test_listen_on_zero_with_host.todo = native_str( # type: ignore
"https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3563"
)
_tub_portlocation(config, _stub_none, _stub_none)
def test_parsing_tcp(self):
"""