Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_bind.py
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | def run_allowip_test(self, allow_ips, rpchost, rpcport): | ||||
['-disablewallet', '-nolisten'] + \ | ['-disablewallet', '-nolisten'] + \ | ||||
['-rpcallowip=' + x for x in allow_ips] + \ | ['-rpcallowip=' + x for x in allow_ips] + \ | ||||
['-rpcbind=' + addr for addr in ['127.0.0.1', | ['-rpcbind=' + addr for addr in ['127.0.0.1', | ||||
"{}:{}".format(rpchost, | "{}:{}".format(rpchost, | ||||
rpcport)]] # Bind to localhost as well so start_nodes doesn't hang | rpcport)]] # Bind to localhost as well so start_nodes doesn't hang | ||||
self.nodes[0].host = None | self.nodes[0].host = None | ||||
self.start_nodes([node_args]) | self.start_nodes([node_args]) | ||||
# connect to node through non-loopback interface | # connect to node through non-loopback interface | ||||
url = rpc_url(self.nodes[0].datadir, rpchost, rpcport) | url = rpc_url(self.nodes[0].datadir, self.chain, rpchost, rpcport) | ||||
node = get_rpc_proxy(url, 0, coveragedir=self.options.coveragedir) | node = get_rpc_proxy(url, 0, coveragedir=self.options.coveragedir) | ||||
node.getnetworkinfo() | node.getnetworkinfo() | ||||
self.stop_nodes() | self.stop_nodes() | ||||
def run_test(self): | def run_test(self): | ||||
# due to OS-specific network stats queries, this test works only on | # due to OS-specific network stats queries, this test works only on | ||||
# Linux | # Linux | ||||
if not sys.platform.startswith('linux'): | if not sys.platform.startswith('linux'): | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |