Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpcbind_test.py
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | 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. | ||||
''' | ''' | ||||
base_args = ['-disablewallet', '-nolisten'] + \ | base_args = ['-disablewallet', '-nolisten'] + \ | ||||
['-rpcallowip=' + x for x in allow_ips] | ['-rpcallowip=' + x for x in allow_ips] | ||||
self.nodes = self.start_nodes( | self.nodes = self.start_nodes( | ||||
self.num_nodes, self.options.tmpdir, [base_args]) | self.num_nodes, self.options.tmpdir, [base_args]) | ||||
# connect to node through non-loopback interface | # connect to node through non-loopback interface | ||||
node = get_rpc_proxy(rpc_url(0, "%s:%d" % (rpchost, rpcport)), 0) | node = get_rpc_proxy(rpc_url(get_datadir_path( | ||||
self.options.tmpdir, 0), 0, "%s:%d" % (rpchost, rpcport)), 0) | |||||
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 Linux | # due to OS-specific network stats queries, this test works only on Linux | ||||
if not sys.platform.startswith('linux'): | if not sys.platform.startswith('linux'): | ||||
raise SkipTest("This test can only be run on linux.") | raise SkipTest("This test can only be run on linux.") | ||||
# find the first non-loopback interface for testing | # find the first non-loopback interface for testing | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |