From d6cab9935d4b3885f5bf7cc8166d58ca2beace3a Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 29 Oct 2020 12:27:42 +0200 Subject: [PATCH] Try to find bootstrap server in knownnodes after bootstrapping --- src/tests/core.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tests/core.py b/src/tests/core.py index fb9f003b..7fb6a9c0 100644 --- a/src/tests/core.py +++ b/src/tests/core.py @@ -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):