Try to find bootstrap server in knownnodes after bootstrapping

This commit is contained in:
Dmitri Bogomolov 2020-10-29 12:27:42 +02:00
parent 2ac4b1fece
commit d6cab9935d
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
1 changed files with 9 additions and 0 deletions

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):