aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_bind_extra.py
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-06-10 12:59:34 +0200
committerMacroFake <falke.marco@gmail.com>2022-06-10 15:56:07 +0200
commitfa7a711a30b707cbdee4435dd0a956bffb7aaccb (patch)
treef096ffc23cab73f1d35b5888872556b07ddfec38 /test/functional/feature_bind_extra.py
parentc3daa321f921f4e2514ef93c48d39ae39e7f2d46 (diff)
test: Fix out-of-range port collisions
Diffstat (limited to 'test/functional/feature_bind_extra.py')
-rwxr-xr-xtest/functional/feature_bind_extra.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/test/functional/feature_bind_extra.py b/test/functional/feature_bind_extra.py
index 6802da8d48..5de9ff203c 100755
--- a/test/functional/feature_bind_extra.py
+++ b/test/functional/feature_bind_extra.py
@@ -18,12 +18,12 @@ from test_framework.test_framework import (
SkipTest,
)
from test_framework.util import (
- PORT_MIN,
- PORT_RANGE,
assert_equal,
+ p2p_port,
rpc_port,
)
+
class BindExtraTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
@@ -33,11 +33,6 @@ class BindExtraTest(BitcoinTestFramework):
self.num_nodes = 2
def setup_network(self):
- # Override setup_network() because we want to put the result of
- # p2p_port() in self.extra_args[], before the nodes are started.
- # p2p_port() is not usable in set_test_params() because PortSeed.n is
- # not set at that time.
-
# Due to OS-specific network stats queries, we only run on Linux.
self.log.info("Checking for Linux")
if not sys.platform.startswith('linux'):
@@ -45,8 +40,8 @@ class BindExtraTest(BitcoinTestFramework):
loopback_ipv4 = addr_to_hex("127.0.0.1")
- # Start custom ports after p2p and rpc ports.
- port = PORT_MIN + 2 * PORT_RANGE
+ # Start custom ports by reusing unused p2p ports
+ port = p2p_port(self.num_nodes)
# Array of tuples [command line arguments, expected bind addresses].
self.expected = []