| 87 | self._run_nonloopback_tests() |
| 88 | |
| 89 | def _run_loopback_tests(self): |
| 90 | if self.options.run_ipv4: |
| 91 | # check only IPv4 localhost (explicit) |
| 92 | self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1'], |
| 93 | [('127.0.0.1', self.defaultport)]) |
| 94 | # check only IPv4 localhost (explicit) with alternative port |
| 95 | self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171'], |
| 96 | [('127.0.0.1', 32171)]) |
| 97 | # check only IPv4 localhost (explicit) with multiple alternative ports on same host |
| 98 | self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171', '127.0.0.1:32172'], |
| 99 | [('127.0.0.1', 32171), ('127.0.0.1', 32172)]) |
| 100 | else: |
| 101 | # check default without rpcallowip (IPv4 and IPv6 localhost) |
| 102 | self.run_bind_test(None, '127.0.0.1', [], |
| 103 | [('127.0.0.1', self.defaultport), ('::1', self.defaultport)]) |
| 104 | # check default with rpcallowip (IPv6 any) |
| 105 | self.run_bind_test(['127.0.0.1'], '127.0.0.1', [], |
| 106 | [('::0', self.defaultport)]) |
| 107 | # check only IPv6 localhost (explicit) |
| 108 | self.run_bind_test(['[::1]'], '[::1]', ['[::1]'], |
| 109 | [('::1', self.defaultport)]) |
| 110 | # check both IPv4 and IPv6 localhost (explicit) |
| 111 | self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1', '[::1]'], |
| 112 | [('127.0.0.1', self.defaultport), ('::1', self.defaultport)]) |
| 113 | |
| 114 | def _run_nonloopback_tests(self): |
| 115 | self.log.info("Using interface %s for testing" % self.non_loopback_ip) |