MCPcopy Create free account
hub / github.com/ElementsProject/elements / run_test

Method run_test

test/functional/feature_bind_extra.py:76–92  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74 # Don't start the nodes, as some of them would collide trying to bind on the same port.
75
76 def run_test(self):
77 for i in range(len(self.expected)):
78 self.log.info(f"Starting node {i} with {self.expected[i][0]}")
79 self.start_node(i)
80 pid = self.nodes[i].process.pid
81 binds = set(get_bind_addrs(pid))
82 # Remove IPv6 addresses because on some CI environments "::1" is not configured
83 # on the system (so our test_ipv6_local() would return False), but it is
84 # possible to bind on "::". This makes it unpredictable whether to expect
85 # that bitcoind has bound on "::1" (for RPC) and "::" (for P2P).
86 ipv6_addr_len_bytes = 32
87 binds = set(filter(lambda e: len(e[0]) != ipv6_addr_len_bytes, binds))
88 # Remove RPC ports. They are not relevant for this test.
89 binds = set(filter(lambda e: e[1] != rpc_port(i), binds))
90 assert_equal(binds, set(self.expected[i][1]))
91 self.stop_node(i)
92 self.log.info(f"Stopped node {i}")
93
94if __name__ == '__main__':
95 BindExtraTest().main()

Callers

nothing calls this directly

Calls 6

get_bind_addrsFunction · 0.90
rpc_portFunction · 0.90
assert_equalFunction · 0.90
infoMethod · 0.80
start_nodeMethod · 0.45
stop_nodeMethod · 0.45

Tested by

no test coverage detected