Merge bitcoin/bitcoin#19013: test: add v0.20.1, v0.21.0 and v22.0 to backwards compatibility test

24cec4b5c0 test: Fix intermittent test failure in feature_backwards_compatibility (MarcoFalke)
d8b705f1ca test: previous releases: add v22.0 (Sjors Provoost)
40849eebd9 test: bump sandbox argument minimum version (Sjors Provoost)
8a57a06a50 test: previous releases: add v0.21.0 (Sjors Provoost)
8cba75f5fd test: v0.20.1 backwards compatibility (Sjors Provoost)
0e4b695b6a test: backwards compatibility: misc fixes (Sjors Provoost)
76557cbe4c test: Remove i686 from test/get_previous_releases.py (MarcoFalke)

Pull request description:

  This also simplifies the tests a bit.

ACKs for top commit:
  ryanofsky:
    Code review ACK 24cec4b5c0. Only change since last review is rebasing and adding comment and whitelist args.

Tree-SHA512: 85a603ddd70fd8f0180d00fb84eb2ad2f92d6199b7d3f7c1abd660bfba53f869faf40f1a4183a8ce15dbd496ee3132d879c1258651c9d443ece69e5fe328bd26
This commit is contained in:
MarcoFalke
2022-02-24 17:40:36 +01:00
5 changed files with 117 additions and 201 deletions

View File

@@ -447,11 +447,15 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
def get_bin_from_version(version, bin_name, bin_default):
if not version:
return bin_default
if version > 219999:
# Starting at client version 220000 the first two digits represent
# the major version, e.g. v22.0 instead of v0.22.0.
version *= 100
return os.path.join(
self.options.previous_releases_path,
re.sub(
r'\.0$',
'', # remove trailing .0 for point releases
r'\.0$' if version <= 219999 else r'(\.0){1,2}$',
'', # Remove trailing dot for point releases, after 22.0 also remove double trailing dot.
'v{}.{}.{}.{}'.format(
(version % 100000000) // 1000000,
(version % 1000000) // 10000,
@@ -473,7 +477,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
versions = [None] * num_nodes
if self.is_syscall_sandbox_compiled() and not self.disable_syscall_sandbox:
for i in range(len(extra_args)):
if versions[i] is None or versions[i] >= 219900:
# The -sandbox argument is not present in the v22.0 release.
if versions[i] is None or versions[i] >= 229900:
extra_args[i] = extra_args[i] + ["-sandbox=log-and-abort"]
if binary is None:
binary = [get_bin_from_version(v, 'bitcoind', self.options.bitcoind) for v in versions]