Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpcbind_test.py
Show All 30 Lines | def run_bind_test(self, allow_ips, connect_to, addresses, expected): | ||||
''' | ''' | ||||
expected = [(addr_to_hex(addr), port) for (addr, port) in expected] | expected = [(addr_to_hex(addr), port) for (addr, port) in expected] | ||||
base_args = ['-disablewallet', '-nolisten'] | base_args = ['-disablewallet', '-nolisten'] | ||||
if allow_ips: | if allow_ips: | ||||
base_args += ['-rpcallowip=' + x for x in allow_ips] | base_args += ['-rpcallowip=' + x for x in allow_ips] | ||||
binds = ['-rpcbind=' + addr for addr in addresses] | binds = ['-rpcbind=' + addr for addr in addresses] | ||||
self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, [ | self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, [ | ||||
base_args + binds], connect_to) | base_args + binds], connect_to) | ||||
pid = bitcoind_processes[0].pid | pid = self.bitcoind_processes[0].pid | ||||
assert_equal(set(get_bind_addrs(pid)), set(expected)) | assert_equal(set(get_bind_addrs(pid)), set(expected)) | ||||
self.stop_nodes() | self.stop_nodes() | ||||
def run_allowip_test(self, allow_ips, rpchost, rpcport): | def run_allowip_test(self, allow_ips, rpchost, rpcport): | ||||
''' | ''' | ||||
Start a node with rpcallow IP, and request getnetworkinfo | Start a node with rpcallow IP, and request getnetworkinfo | ||||
at a non-localhost IP. | at a non-localhost IP. | ||||
''' | ''' | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |