tahoe.cfg: add tub.port=listen:i2p (and/or listen:tor)

This delegates the construction of the server Endpoint object to the i2p/tor
Provider, which can use the i2p/tor section of the config file to add options
which would be awkward to express as text in an endpoint descriptor string.

refs ticket:2889 (but note this merely makes room for a function to be
written that can process I2CP options, it does not actually handle such
options, so it does not close this ticket yet)
This commit is contained in:
Brian Warner
2017-07-19 12:24:24 -05:00
parent d1fd43aa4f
commit 097abb42fa
7 changed files with 103 additions and 6 deletions

View File

@ -393,6 +393,20 @@ class Provider(unittest.TestCase):
self.assertIs(h, handler)
tor.default_socks.assert_called_with()
class Provider_Listener(unittest.TestCase):
def test_listener(self):
tor = mock.Mock()
handler = object()
tor.socks_endpoint = mock.Mock(return_value=handler)
reactor = object()
with mock_tor(tor):
p = tor_provider.Provider("basedir",
FakeConfig(**{"onion.local_port": "321"}),
reactor)
endpoint_or_description = p.get_listener()
self.assertEqual(endpoint_or_description, "tcp:321:interface=127.0.0.1")
class Provider_CheckOnionConfig(unittest.TestCase):
def test_default(self):
# default config doesn't start an onion service, so it should be