@@ -48,9 +48,12 @@ def run_allowip_test(self, allow_ips, rpchost, rpcport):
48
48
at a non-localhost IP.
49
49
'''
50
50
self .log .info ("Allow IP test for %s:%d" % (rpchost , rpcport ))
51
- base_args = ['-disablewallet' , '-nolisten' ] + ['-rpcallowip=' + x for x in allow_ips ]
51
+ node_args = \
52
+ ['-disablewallet' , '-nolisten' ] + \
53
+ ['-rpcallowip=' + x for x in allow_ips ] + \
54
+ ['-rpcbind=' + addr for addr in ['127.0.0.1' , "%s:%d" % (rpchost , rpcport )]] # Bind to localhost as well so start_nodes doesn't hang
52
55
self .nodes [0 ].rpchost = None
53
- self .start_nodes ([base_args ])
56
+ self .start_nodes ([node_args ])
54
57
# connect to node through non-loopback interface
55
58
node = get_rpc_proxy (rpc_url (self .nodes [0 ].datadir , 0 , "%s:%d" % (rpchost , rpcport )), 0 , coveragedir = self .options .coveragedir )
56
59
node .getnetworkinfo ()
@@ -101,9 +104,9 @@ def _run_loopback_tests(self):
101
104
# check default without rpcallowip (IPv4 and IPv6 localhost)
102
105
self .run_bind_test (None , '127.0.0.1' , [],
103
106
[('127.0.0.1' , self .defaultport ), ('::1' , self .defaultport )])
104
- # check default with rpcallowip (IPv6 any )
107
+ # check default with rpcallowip (IPv4 and IPv6 localhost )
105
108
self .run_bind_test (['127.0.0.1' ], '127.0.0.1' , [],
106
- [('::0 ' , self .defaultport )])
109
+ [('127.0.0.1' , self . defaultport ), ( '::1 ' , self .defaultport )])
107
110
# check only IPv6 localhost (explicit)
108
111
self .run_bind_test (['[::1]' ], '[::1]' , ['[::1]' ],
109
112
[('::1' , self .defaultport )])
0 commit comments