Try to find bootstrap server in knownnodes after bootstrapping

This commit is contained in:
Dmitri Bogomolov 2020-10-29 12:27:42 +02:00 committed by Muzahid
parent 1a3a7089cc
commit 1b198e9a4a
Signed by untrusted user: cis-muzahid
GPG Key ID: 1DC85E7D3AB613EA

View File

@ -204,6 +204,13 @@ class TestCore(unittest.TestCase):
self.fail(
'Failed to connect during %s sec' % (time.time() - _started))
def _check_knownnodes(self):
for stream in knownnodes.knownNodes.itervalues():
for peer in stream:
if peer.host.startswith('bootstrap'):
self.fail(
'Bootstrap server in knownnodes: %s' % peer.host)
def test_dontconnect(self):
"""all connections are closed 5 seconds after setting dontconnect"""
self._initiate_bootstrap()
@ -229,6 +236,7 @@ class TestCore(unittest.TestCase):
BMConfigParser().set('bitmessagesettings', 'socksproxytype', 'none')
self._initiate_bootstrap()
self._check_connection()
self._check_knownnodes()
@unittest.skipIf(tor_port_free, 'no running tor detected')
def test_bootstrap_tor(self):
@ -236,6 +244,7 @@ class TestCore(unittest.TestCase):
BMConfigParser().set('bitmessagesettings', 'socksproxytype', 'SOCKS5')
self._initiate_bootstrap()
self._check_connection()
self._check_knownnodes()
@unittest.skipIf(tor_port_free, 'no running tor detected')
def test_onionservicesonly(self):