From 47ff5098ad5ea2c20ea387f99940a7cde6c80789 Mon Sep 17 00:00:00 2001 From: Amiti Uttarwar Date: Fri, 4 Sep 2020 13:37:24 -0700 Subject: [PATCH] [test] Clarify setup of node topology. Since the test framework automatically sets up a connection between the nodes, the second connect_nodes call was a no-op. Remove the redundant call & add comments to explain the expected topology. --- test/functional/p2p_disconnect_ban.py | 5 ++++- test/functional/rpc_net.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/functional/p2p_disconnect_ban.py b/test/functional/p2p_disconnect_ban.py index 3088a8aa462..a7f51b53642 100755 --- a/test/functional/p2p_disconnect_ban.py +++ b/test/functional/p2p_disconnect_ban.py @@ -18,8 +18,11 @@ class DisconnectBanTest(BitcoinTestFramework): def run_test(self): self.log.info("Connect nodes both way") + # By default, the test framework sets up an addnode connection from + # node 1 --> node0. By connecting node0 --> node 1, we're left with + # the two nodes being connected both ways. + # Topology will look like: node0 <--> node1 self.connect_nodes(0, 1) - self.connect_nodes(1, 0) self.log.info("Test setban and listbanned RPCs") diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index f8421360c55..03c858c6941 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -51,9 +51,12 @@ class NetTest(BitcoinTestFramework): def run_test(self): # Get out of IBD for the minfeefilter and getpeerinfo tests. self.nodes[0].generate(101) - # Connect nodes both ways. + + # By default, the test framework sets up an addnode connection from + # node 1 --> node0. By connecting node0 --> node 1, we're left with + # the two nodes being connected both ways. + # Topology will look like: node0 <--> node1 self.connect_nodes(0, 1) - self.connect_nodes(1, 0) self.sync_all() self.test_connection_count()