MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / run_allowip_test

Method run_allowip_test

test/functional/rpc_bind.py:45–57  ·  view source on GitHub ↗

Start a node with rpcallow IP, and request getnetworkinfo at a non-localhost IP.

(self, allow_ips, rpchost, rpcport)

Source from the content-addressed store, hash-verified

43 self.stop_nodes()
44
45 def run_allowip_test(self, allow_ips, rpchost, rpcport):
46 '''
47 Start a node with rpcallow IP, and request getnetworkinfo
48 at a non-localhost IP.
49 '''
50 self.log.info("Allow IP test for %s:%d" % (rpchost, rpcport))
51 base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips]
52 self.nodes[0].rpchost = None
53 self.start_nodes([base_args])
54 # connect to node through non-loopback interface
55 node = get_rpc_proxy(rpc_url(self.nodes[0].datadir, 0, "%s:%d" % (rpchost, rpcport)), 0, coveragedir=self.options.coveragedir)
56 node.getnetworkinfo()
57 self.stop_nodes()
58
59 def run_test(self):
60 # due to OS-specific network stats queries, this test works only on Linux

Callers 1

Calls 5

get_rpc_proxyFunction · 0.90
rpc_urlFunction · 0.90
infoMethod · 0.80
start_nodesMethod · 0.80
stop_nodesMethod · 0.80

Tested by

no test coverage detected