MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / run_invalid_bind_test

Method run_invalid_bind_test

test/functional/rpc_bind.py:47–58  ·  view source on GitHub ↗

Attempt to start a node with requested rpcallowip and rpcbind parameters, expecting that the node will fail.

(self, allow_ips, addresses)

Source from the content-addressed store, hash-verified

45 self.stop_nodes()
46
47 def run_invalid_bind_test(self, allow_ips, addresses):
48 '''
49 Attempt to start a node with requested rpcallowip and rpcbind
50 parameters, expecting that the node will fail.
51 '''
52 self.log.info(f'Invalid bind test for {addresses}')
53 base_args = ['-disablewallet', '-nolisten']
54 if allow_ips:
55 base_args += ['-rpcallowip=' + x for x in allow_ips]
56 init_error = 'Error: Invalid port specified in -rpcbind: '
57 for addr in addresses:
58 self.nodes[0].assert_start_raises_init_error(base_args + [f'-rpcbind={addr}'], init_error + f"'{addr}'")
59
60 def run_allowip_test(self, allow_ips, rpchost, rpcport):
61 '''

Callers 1

run_testMethod · 0.95

Calls 2

infoMethod · 0.80

Tested by

no test coverage detected