From 7735c134887c9ab25d4ec3dc1981b5e4ae4b3ece Mon Sep 17 00:00:00 2001 From: Michael Dietz Date: Tue, 2 Jun 2026 09:28:46 -0500 Subject: [PATCH] test: run bitcoin-cli -ipcconnect check under valgrind with -datadir This case invoked bitcoin-cli via raw subprocess.run() without the valgrind wrapper (bypassing valgrind) and without -datadir (so it read the default datadir's bitcoin.conf, e.g. ~/.bitcoin, and failed whenever that real config was unusable). Build the command like the rest of the framework: prepend binaries.valgrind_cmd and pass the node's -datadir so the check runs under valgrind and depends only on the build's IPC support, not the host environment. --- test/functional/interface_bitcoin_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/interface_bitcoin_cli.py b/test/functional/interface_bitcoin_cli.py index effd45fdec3..07687c5d0b2 100755 --- a/test/functional/interface_bitcoin_cli.py +++ b/test/functional/interface_bitcoin_cli.py @@ -458,7 +458,8 @@ class TestBitcoinCli(BitcoinTestFramework): # This tests behavior when ENABLE_IPC is off. When it is on, # behavior is checked by the interface_ipc_cli.py test. self.log.info("Test bitcoin-cli -ipcconnect triggers error if not built with IPC support") - args = [self.binary_paths.bitcoincli, "-ipcconnect=unix", "-getinfo"] + # node.cli.options includes -rpcconnect which can't be combined with -ipcconnect, so pass just -datadir directly to keep bitcoin-cli on the test's bitcoin.conf + args = self.nodes[0].binaries.valgrind_cmd + [self.nodes[0].binaries.paths.bitcoincli, f"-datadir={self.nodes[0].datadir_path}", "-ipcconnect=unix", "-getinfo"] result = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) assert_equal(result.stdout, "error: bitcoin-cli was not built with IPC support\n") assert_equal(result.stderr, None)