MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / _run_nonloopback_tests

Method _run_nonloopback_tests

test/functional/rpc_bind.py:158–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

156 [('127.0.0.1', self.defaultport), ('::1', self.defaultport)])
157
158 def _run_nonloopback_tests(self):
159 self.log.info("Using interface %s for testing" % self.non_loopback_ip)
160
161 # check only non-loopback interface
162 self.run_bind_test([self.non_loopback_ip], self.non_loopback_ip, [self.non_loopback_ip],
163 [(self.non_loopback_ip, self.defaultport)])
164
165 # Check that with invalid rpcallowip, we are denied
166 self.run_allowip_test([self.non_loopback_ip], self.non_loopback_ip, self.defaultport)
167 if self.options.usecli:
168 self.log.info("Skip negative IP test with CLI, because the CLI can not throw the tested exception type")
169 return
170 assert_raises_rpc_error(-342, "non-JSON HTTP response with '403 Forbidden' from server", self.run_allowip_test, ['1.1.1.1'], self.non_loopback_ip, self.defaultport)
171
172if __name__ == '__main__':
173 RPCBindTest(__file__).main()

Callers 1

run_testMethod · 0.95

Calls 4

run_bind_testMethod · 0.95
run_allowip_testMethod · 0.95
assert_raises_rpc_errorFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected