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