From 1fc7b9d260c51e674487f544624299d39cbfd71f Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 24 Apr 2025 10:21:40 +0200 Subject: [PATCH] test: Add imports for util bpf_cflags This is required for the next commit. Github-Pull: #32336 Rebased-From: fa0c1baaf89805182de56d6a2e8eed2265a94b40 --- test/functional/interface_usdt_coinselection.py | 3 ++- test/functional/interface_usdt_mempool.py | 7 +++++-- test/functional/interface_usdt_net.py | 7 +++++-- test/functional/interface_usdt_utxocache.py | 7 +++++-- test/functional/interface_usdt_validation.py | 8 +++++--- test/functional/test_framework/util.py | 7 +++++++ 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/test/functional/interface_usdt_coinselection.py b/test/functional/interface_usdt_coinselection.py index 30931a41cd2..3d4fd066926 100755 --- a/test/functional/interface_usdt_coinselection.py +++ b/test/functional/interface_usdt_coinselection.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -17,6 +17,7 @@ from test_framework.util import ( assert_equal, assert_greater_than, assert_raises_rpc_error, + bpf_cflags, ) coinselection_tracepoints_program = """ diff --git a/test/functional/interface_usdt_mempool.py b/test/functional/interface_usdt_mempool.py index 0168d9f916a..6986e7bf12a 100755 --- a/test/functional/interface_usdt_mempool.py +++ b/test/functional/interface_usdt_mempool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -19,7 +19,10 @@ from test_framework.blocktools import COINBASE_MATURITY from test_framework.messages import COIN, DEFAULT_MEMPOOL_EXPIRY_HOURS from test_framework.p2p import P2PDataStore from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal +from test_framework.util import ( + assert_equal, + bpf_cflags, +) from test_framework.wallet import MiniWallet MEMPOOL_TRACEPOINTS_PROGRAM = """ diff --git a/test/functional/interface_usdt_net.py b/test/functional/interface_usdt_net.py index 58570399c19..cbf4dda3867 100755 --- a/test/functional/interface_usdt_net.py +++ b/test/functional/interface_usdt_net.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -17,7 +17,10 @@ except ImportError: from test_framework.messages import msg_version from test_framework.p2p import P2PInterface from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal +from test_framework.util import ( + assert_equal, + bpf_cflags, +) # Tor v3 addresses are 62 chars + 6 chars for the port (':12345'). MAX_PEER_ADDR_LENGTH = 68 diff --git a/test/functional/interface_usdt_utxocache.py b/test/functional/interface_usdt_utxocache.py index 06cdcd10a04..f33a7fd3af9 100755 --- a/test/functional/interface_usdt_utxocache.py +++ b/test/functional/interface_usdt_utxocache.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -15,7 +15,10 @@ except ImportError: pass from test_framework.messages import COIN from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal +from test_framework.util import ( + assert_equal, + bpf_cflags, +) from test_framework.wallet import MiniWallet utxocache_changes_program = """ diff --git a/test/functional/interface_usdt_validation.py b/test/functional/interface_usdt_validation.py index 30982393d85..bce59df02a8 100755 --- a/test/functional/interface_usdt_validation.py +++ b/test/functional/interface_usdt_validation.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -17,8 +17,10 @@ except ImportError: from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal - +from test_framework.util import ( + assert_equal, + bpf_cflags, +) validation_blockconnected_program = """ #include diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index b4b05b15972..645cc7c21dc 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -277,6 +277,13 @@ def wait_until_helper_internal(predicate, *, attempts=float('inf'), timeout=floa raise RuntimeError('Unreachable') +def bpf_cflags(): + return [ + "-Wno-error=implicit-function-declaration", + "-Wno-duplicate-decl-specifier", # https://github.com/bitcoin/bitcoin/issues/32322 + ] + + def sha256sum_file(filename): h = hashlib.sha256() with open(filename, 'rb') as f: