aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpcbind_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/rpcbind_test.py')
-rwxr-xr-xtest/functional/rpcbind_test.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/functional/rpcbind_test.py b/test/functional/rpcbind_test.py
index 20808207b2..e9d64af204 100755
--- a/test/functional/rpcbind_test.py
+++ b/test/functional/rpcbind_test.py
@@ -20,10 +20,7 @@ class RPCBindTest(BitcoinTestFramework):
self.num_nodes = 1
def setup_network(self):
- pass
-
- def setup_nodes(self):
- pass
+ self.add_nodes(self.num_nodes, self.options.tmpdir, None)
def run_bind_test(self, allow_ips, connect_to, addresses, expected):
'''
@@ -31,12 +28,14 @@ class RPCBindTest(BitcoinTestFramework):
then try to connect, and check if the set of bound addresses
matches the expected set.
'''
+ self.log.info("Bind test for %s" % str(addresses))
expected = [(addr_to_hex(addr), port) for (addr, port) in expected]
base_args = ['-disablewallet', '-nolisten']
if allow_ips:
base_args += ['-rpcallowip=' + x for x in allow_ips]
binds = ['-rpcbind='+addr for addr in addresses]
- self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, [base_args + binds], connect_to)
+ self.nodes[0].rpchost = connect_to
+ self.start_node(0, base_args + binds)
pid = self.nodes[0].process.pid
assert_equal(set(get_bind_addrs(pid)), set(expected))
self.stop_nodes()
@@ -46,8 +45,10 @@ class RPCBindTest(BitcoinTestFramework):
Start a node with rpcallow IP, and request getnetworkinfo
at a non-localhost IP.
'''
+ self.log.info("Allow IP test for %s:%d" % (rpchost, rpcport))
base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips]
- self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, [base_args])
+ self.nodes[0].rpchost = None
+ self.start_nodes([base_args])
# connect to node through non-loopback interface
node = get_rpc_proxy(rpc_url(get_datadir_path(self.options.tmpdir, 0), 0, "%s:%d" % (rpchost, rpcport)), 0, coveragedir=self.options.coveragedir)
node.getnetworkinfo()