MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / run_test

Method run_test

test/functional/rpc_bind.py:59–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

_run_loopback_testsMethod · 0.95
SkipTestClass · 0.90
test_ipv6_localFunction · 0.90
all_interfacesFunction · 0.90
rpc_portFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected