def METHOD_NAME(self):
    # due to OS-specific network stats queries, this test works only on Linux
    if sum([self.options.run_ipv4, self.options.run_ipv6, self.options.run_nonloopback]) > 1:
        raise AssertionError("Only one of --ipv4, --ipv6 and --nonloopback can be set")
    self.log.info("Check for linux")
    if not sys.platform.startswith('linux'):
        raise SkipTest("This test can only be run on linux.")
    self.log.info("Check for ipv6")
    have_ipv6 = test_ipv6_local()
    if not have_ipv6 and not (self.options.run_ipv4 or self.options.run_nonloopback):
        raise SkipTest("This test requires ipv6 support.")
    self.log.info("Check for non-loopback interface")
    self.non_loopback_ip = None
    for name,ip in all_interfaces():
        if ip != '127.0.0.1':
            self.non_loopback_ip = ip
            break
    if self.non_loopback_ip is None and self.options.run_nonloopback:
        raise SkipTest("This test requires a non-loopback ip address.")
    self.defaultport = rpc_port(0)
    if not self.options.run_nonloopback:
        self._run_loopback_tests()
    if not self.options.run_ipv4 and not self.options.run_ipv6:
        self._run_nonloopback_tests()