Add test for 'onionservicesonly' mode.

Credit to Dmitri Bogomolov in commit 557a8cc6d2bec881b8a3c531d3f725460ed515f5.
v0.6
George McCandless 3 years ago
parent b42f536d23
commit f871cd450c
No known key found for this signature in database
GPG Key ID: 62B9F5A4802A74BD

@ -173,6 +173,22 @@ class TestCore(unittest.TestCase):
self.fail(
'Failed to connect during %s sec' % (time.time() - _started))
def test_onionservicesonly(self):
"""test onionservicesonly networking mode"""
BMConfigParser().set('bitmessagesettings', 'onionservicesonly', True)
self._initiate_bootstrap()
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
for _ in range(360):
time.sleep(1)
for n, peer in enumerate(BMConnectionPool().outboundConnections):
if n > 2:
return
if not peer.host.endswith('.onion'):
self.fail(
'Found non onion hostname %s in outbound connections!'
% peer.host)
self.fail('Failed to connect to at least 3 nodes within 360 sec')
def test_bootstrap(self):
"""test bootstrapping"""
self._initiate_bootstrap()

Loading…
Cancel
Save