(self)
| 61 | self.stop_nodes() |
| 62 | |
| 63 | def run_test(self): |
| 64 | # due to OS-specific network stats queries, this test works only on Linux |
| 65 | if sum([self.options.run_ipv4, self.options.run_ipv6, self.options.run_nonloopback]) > 1: |
| 66 | raise AssertionError("Only one of --ipv4, --ipv6 and --nonloopback can be set") |
| 67 | |
| 68 | self.log.info("Check for linux") |
| 69 | if not sys.platform.startswith('linux'): |
| 70 | raise SkipTest("This test can only be run on linux.") |
| 71 | |
| 72 | self.log.info("Check for ipv6") |
| 73 | have_ipv6 = test_ipv6_local() |
| 74 | if not have_ipv6 and not (self.options.run_ipv4 or self.options.run_nonloopback): |
| 75 | raise SkipTest("This test requires ipv6 support.") |
| 76 | |
| 77 | self.log.info("Check for non-loopback interface") |
| 78 | self.non_loopback_ip = None |
| 79 | for name,ip in all_interfaces(): |
| 80 | if ip != '127.0.0.1': |
| 81 | self.non_loopback_ip = ip |
| 82 | break |
| 83 | if self.non_loopback_ip is None and self.options.run_nonloopback: |
| 84 | raise SkipTest("This test requires a non-loopback ip address.") |
| 85 | |
| 86 | self.defaultport = rpc_port(0) |
| 87 | |
| 88 | if not self.options.run_nonloopback: |
| 89 | self._run_loopback_tests() |
| 90 | if not self.options.run_ipv4 and not self.options.run_ipv6: |
| 91 | self._run_nonloopback_tests() |
| 92 | |
| 93 | def _run_loopback_tests(self): |
| 94 | if self.options.run_ipv4: |
nothing calls this directly
no test coverage detected