mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge bitcoin/bitcoin#28805: test: Make existing functional tests compatible with --v2transport
35fb9930adtest: enable v2 transport for p2p_timeouts.py (Martin Zumsande)2c1669c37atest: enable v2 transport for rpc_net.py (Sebastian Falbesoner)cc961c2695test: enable v2 transport for p2p_node_network_limited.py (Sebastian Falbesoner)3598a1b5c9test: enable --v2transport in combination with --usecli (Martin Zumsande)68a9001751test: persist -v2transport over restarts and respect -v2transport=0 (Martin Zumsande) Pull request description: This makes the functional test suite compatible with BIP324, so that `python3 test_runner.py --v2transport` should succeed (currently, 12 tests fail for me on master). Includes two commits by TheStack I found in an old discussion https://github.com/bitcoin/bitcoin/pull/28331#discussion_r1326714164 Note that even though all tests should pass, the python `p2p.py` module will do v2 connections only after the merge of #24748, so that for now only connections between two full nodes will actually run v2. Some of the fixed tests were added with `--v2transport` to the test runner. Though after #24748 we might also want to consider running the entire suite with `--v2transport` in some CI. ACKs for top commit: sipa: utACK35fb9930ad. Thanks for taking care of this. achow101: ACK35fb9930adtheStack: ACK35fb9930adstratospher: ACK35fb993. Tree-SHA512: 80dc0bf211fa525ff1d092043aea9f222f14c02e5832a548fb8b83b9ede1fcee03c5e8ade0d05c331bdaa492af9c1cf3d0f0b15b846673c6eacea82dd4cefbc3
This commit is contained in:
@@ -507,8 +507,6 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
assert_equal(len(binary_cli), num_nodes)
|
||||
for i in range(num_nodes):
|
||||
args = list(extra_args[i])
|
||||
if self.options.v2transport and ("-v2transport=0" not in args):
|
||||
args.append("-v2transport=1")
|
||||
test_node_i = TestNode(
|
||||
i,
|
||||
get_datadir_path(self.options.tmpdir, i),
|
||||
@@ -527,6 +525,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
start_perf=self.options.perf,
|
||||
use_valgrind=self.options.valgrind,
|
||||
descriptors=self.options.descriptors,
|
||||
v2transport=self.options.v2transport,
|
||||
)
|
||||
self.nodes.append(test_node_i)
|
||||
if not test_node_i.version_is_at_least(170000):
|
||||
@@ -601,7 +600,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
ip_port = "127.0.0.1:" + str(p2p_port(b))
|
||||
|
||||
if peer_advertises_v2 is None:
|
||||
peer_advertises_v2 = self.options.v2transport
|
||||
peer_advertises_v2 = from_connection.use_v2transport
|
||||
|
||||
if peer_advertises_v2:
|
||||
from_connection.addnode(node=ip_port, command="onetry", v2transport=True)
|
||||
|
||||
Reference in New Issue
Block a user