@@ -56,9 +56,12 @@ def run_allowip_test(self, allow_ips, rpchost, rpcport):
56
56
at a non-localhost IP.
57
57
'''
58
58
self .log .info ("Allow IP test for %s:%d" % (rpchost , rpcport ))
59
- base_args = ['-disablewallet' , '-nolisten' ] + ['-rpcallowip=' + x for x in allow_ips ]
59
+ node_args = \
60
+ ['-disablewallet' , '-nolisten' ] + \
61
+ ['-rpcallowip=' + x for x in allow_ips ] + \
62
+ ['-rpcbind=' + addr for addr in ['127.0.0.1' , "%s:%d" % (rpchost , rpcport )]] # Bind to localhost as well so start_nodes doesn't hang
60
63
self .nodes [0 ].rpchost = None
61
- self .start_nodes ([base_args ])
64
+ self .start_nodes ([node_args ])
62
65
# connect to node through non-loopback interface
63
66
node = get_rpc_proxy (rpc_url (get_datadir_path (self .options .tmpdir , 0 ), 0 , "%s:%d" % (rpchost , rpcport )), 0 , coveragedir = self .options .coveragedir )
64
67
node .getnetworkinfo ()
@@ -109,9 +112,9 @@ def _run_loopback_tests(self):
109
112
# check default without rpcallowip (IPv4 and IPv6 localhost)
110
113
self .run_bind_test (None , '127.0.0.1' , [],
111
114
[('127.0.0.1' , self .defaultport ), ('::1' , self .defaultport )])
112
- # check default with rpcallowip (IPv6 any )
115
+ # check default with rpcallowip (IPv4 and IPv6 localhost )
113
116
self .run_bind_test (['127.0.0.1' ], '127.0.0.1' , [],
114
- [('::0 ' , self .defaultport )])
117
+ [('127.0.0.1' , self . defaultport ), ( '::1 ' , self .defaultport )])
115
118
# check only IPv6 localhost (explicit)
116
119
self .run_bind_test (['[::1]' ], '[::1]' , ['[::1]' ],
117
120
[('::1' , self .defaultport )])
0 commit comments