| 131 | self.log.info('Non-loopback IP address not found, skipping non-loopback tests') |
| 132 | |
| 133 | def _run_loopback_tests(self): |
| 134 | if self.options.run_ipv4: |
| 135 | # check only IPv4 localhost (explicit) |
| 136 | self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1'], |
| 137 | [('127.0.0.1', self.defaultport)]) |
| 138 | # check only IPv4 localhost (explicit) with alternative port |
| 139 | self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171'], |
| 140 | [('127.0.0.1', 32171)]) |
| 141 | # check only IPv4 localhost (explicit) with multiple alternative ports on same host |
| 142 | self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171', '127.0.0.1:32172'], |
| 143 | [('127.0.0.1', 32171), ('127.0.0.1', 32172)]) |
| 144 | else: |
| 145 | # check default without rpcallowip (IPv4 and IPv6 localhost) |
| 146 | self.run_bind_test(None, '127.0.0.1', [], |
| 147 | [('127.0.0.1', self.defaultport), ('::1', self.defaultport)]) |
| 148 | # check default with rpcallowip (IPv4 and IPv6 localhost) |
| 149 | self.run_bind_test(['127.0.0.1'], '127.0.0.1', [], |
| 150 | [('127.0.0.1', self.defaultport), ('::1', self.defaultport)]) |
| 151 | # check only IPv6 localhost (explicit) |
| 152 | self.run_bind_test(['[::1]'], '[::1]', ['[::1]'], |
| 153 | [('::1', self.defaultport)]) |
| 154 | # check both IPv4 and IPv6 localhost (explicit) |
| 155 | self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1', '[::1]'], |
| 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) |