From fa4fc8c1d7b59461dcce559522652d26563266f0 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 22 May 2026 16:38:35 +0200 Subject: [PATCH 1/5] test: Set TestNode url field early, so that feature_loadblock.py --usecli works --- test/functional/feature_loadblock.py | 1 - test/functional/test_framework/test_node.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/functional/feature_loadblock.py b/test/functional/feature_loadblock.py index fc942cadc47..417ecff5e94 100755 --- a/test/functional/feature_loadblock.py +++ b/test/functional/feature_loadblock.py @@ -25,7 +25,6 @@ class LoadblockTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 - self.supports_cli = False def run_test(self): self.nodes[1].setnetworkactive(state=False) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 1d564a869bf..22d76cacbcf 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -379,11 +379,11 @@ class TestNode(): self.log.debug("RPC successfully started") # Set rpc_connected even if we are in use_cli mode so that we know we can call self.stop() if needed. self.rpc_connected = True + self.url = rpc.rpc_url self.cli = self.create_new_rpc_connection(mode="CLI") if self.use_cli: return self._rpc = rpc - self.url = self._rpc.rpc_url return except JSONRPCException as e: # Suppress these as they are expected during initialization. From faf993ee44216aba9b85aee40ae749ae4d5d94e4 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 22 May 2026 17:11:35 +0200 Subject: [PATCH 2/5] test: Stop node before modifying config to support rpc_users.py --usecli Otherwise, bitcoin-cli will read the wrong config from the "future". --- test/functional/rpc_users.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py index 9650480a553..3eec97f124c 100755 --- a/test/functional/rpc_users.py +++ b/test/functional/rpc_users.py @@ -36,7 +36,6 @@ def call_with_auth(node, user, password, method="getbestblockhash"): class HTTPBasicsTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 2 - self.supports_cli = False def conf_setup(self): #Append rpcauth to bitcoin.conf before initialization @@ -61,6 +60,7 @@ class HTTPBasicsTest(BitcoinTestFramework): rpcauth3 = lines[1] self.password = lines[3] + self.stop_nodes() with open(self.nodes[0].datadir_path / "bitcoin.conf", "a") as f: f.write(rpcauth + "\n") f.write(rpcauth2 + "\n") @@ -68,8 +68,7 @@ class HTTPBasicsTest(BitcoinTestFramework): with open(self.nodes[1].datadir_path / "bitcoin.conf", "a") as f: f.write("rpcuser={}\n".format(self.rpcuser)) f.write("rpcpassword={}\n".format(self.rpcpassword)) - self.restart_node(0) - self.restart_node(1) + self.start_nodes() def test_auth(self, node, user, password): self.log.info('Correct...') @@ -109,6 +108,7 @@ class HTTPBasicsTest(BitcoinTestFramework): assert_equal(expected_perms, actual_perms) # Remove any leftover rpc{user|password} config options from previous tests + self.stop_node(1) self.nodes[1].replace_in_config([("rpcuser", "#rpcuser"), ("rpcpassword", "#rpcpassword")]) self.log.info('Check default cookie permission') From faf0f848ef18e1d917bce942a2c09cadf1211a7e Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 22 May 2026 17:34:15 +0200 Subject: [PATCH 3/5] test: use echojson to allow rpc_named_arguments.py --usecli The echo and echojson RPCs are identical in the server. The only difference is that echojson is in the client conversion table. --- test/functional/rpc_named_arguments.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/functional/rpc_named_arguments.py b/test/functional/rpc_named_arguments.py index ce1bbda41a9..9f8248c833f 100755 --- a/test/functional/rpc_named_arguments.py +++ b/test/functional/rpc_named_arguments.py @@ -10,10 +10,10 @@ from test_framework.util import ( assert_raises_rpc_error, ) + class NamedArgumentTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 - self.supports_cli = False def run_test(self): node = self.nodes[0] @@ -25,14 +25,14 @@ class NamedArgumentTest(BitcoinTestFramework): h = node.getblockhash(height=0) node.getblock(blockhash=h) - assert_equal(node.echo(), []) - assert_equal(node.echo(arg0=0,arg9=9), [0] + [None]*8 + [9]) - assert_equal(node.echo(arg1=1), [None, 1]) - assert_equal(node.echo(arg9=None), [None]*10) - assert_equal(node.echo(arg0=0,arg3=3,arg9=9), [0] + [None]*2 + [3] + [None]*5 + [9]) - assert_equal(node.echo(0, 1, arg3=3, arg5=5), [0, 1, None, 3, None, 5]) - assert_raises_rpc_error(-8, "Parameter arg1 specified twice both as positional and named argument", node.echo, 0, 1, arg1=1) - assert_raises_rpc_error(-8, "Parameter arg1 specified twice both as positional and named argument", node.echo, 0, None, 2, arg1=1) + assert_equal(node.echojson(), []) + assert_equal(node.echojson(arg0=0, arg9=9), [0] + [None] * 8 + [9]) + assert_equal(node.echojson(arg1=1), [None, 1]) + assert_equal(node.echojson(arg9=None), [] if self.options.usecli else [None] * 10) + assert_equal(node.echojson(arg0=0, arg3=3, arg9=9), [0] + [None] * 2 + [3] + [None] * 5 + [9]) + assert_equal(node.echojson(0, 1, arg3=3, arg5=5), [0, 1, None, 3, None, 5]) + assert_raises_rpc_error(-8, "Parameter arg1 specified twice both as positional and named argument", node.echojson, 0, 1, arg1=1) + assert_raises_rpc_error(-8, "Parameter arg1 specified twice both as positional and named argument", node.echojson, 0, None, 2, arg1=1) if __name__ == '__main__': NamedArgumentTest(__file__).main() From fa8d4d5c35ef021c94e30ce7fe5a4c728b6decd5 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 26 May 2026 07:48:56 +0200 Subject: [PATCH 4/5] test: Catch CalledProcessError to support --usecli in feature_dbcrash.py --- test/functional/feature_dbcrash.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py index cc94be781d1..6b6c63c4557 100755 --- a/test/functional/feature_dbcrash.py +++ b/test/functional/feature_dbcrash.py @@ -28,6 +28,7 @@ import errno import http.client import random +import subprocess import time from test_framework.blocktools import COINBASE_MATURITY @@ -49,7 +50,6 @@ class ChainstateWriteCrashTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 4 self.rpc_timeout = 480 - self.supports_cli = False # Set -maxmempool=0 to turn off mempool memory sharing with dbcache self.base_args = [ @@ -113,6 +113,9 @@ class ChainstateWriteCrashTest(BitcoinTestFramework): except (http.client.CannotSendRequest, http.client.RemoteDisconnected) as e: self.log.debug(f"node {node_index} submitblock raised exception: {e}") return False + except subprocess.CalledProcessError as e: + self.log.debug(f"node {node_index} submitblock raised CalledProcessError: {e}") + return False except OSError as e: self.log.debug(f"node {node_index} submitblock raised OSError exception: errno={e.errno}") if e.errno in [errno.EPIPE, errno.ECONNREFUSED, errno.ECONNRESET]: From fa24693819e054c4e795dcaa510f17a757421b9e Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 22 May 2026 16:47:44 +0200 Subject: [PATCH 5/5] test: Allow --usecli in tests that already support it --- test/functional/feature_coinstatsindex_compatibility.py | 1 - test/functional/interface_http.py | 1 - test/functional/interface_rest.py | 1 - test/functional/rpc_whitelist.py | 1 - test/functional/wallet_txn_clone.py | 1 - 5 files changed, 5 deletions(-) diff --git a/test/functional/feature_coinstatsindex_compatibility.py b/test/functional/feature_coinstatsindex_compatibility.py index 855dc74d82e..21496a9cbd1 100755 --- a/test/functional/feature_coinstatsindex_compatibility.py +++ b/test/functional/feature_coinstatsindex_compatibility.py @@ -16,7 +16,6 @@ from test_framework.util import assert_equal class CoinStatsIndexTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 2 - self.supports_cli = False self.extra_args = [["-coinstatsindex"],["-coinstatsindex"]] def skip_test_if_missing_module(self): diff --git a/test/functional/interface_http.py b/test/functional/interface_http.py index cfa111b753d..51a3a653824 100755 --- a/test/functional/interface_http.py +++ b/test/functional/interface_http.py @@ -95,7 +95,6 @@ class BitcoinHTTPConnection: class HTTPBasicsTest (BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 - self.supports_cli = False def setup_network(self): self.setup_nodes() diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py index 2009752cc7f..07b42e6b2e9 100755 --- a/test/functional/interface_rest.py +++ b/test/functional/interface_rest.py @@ -55,7 +55,6 @@ class RESTTest (BitcoinTestFramework): self.extra_args = [["-rest", "-blockfilterindex=1"], []] # whitelist peers to speed up tx relay / mempool sync self.noban_tx_relay = True - self.supports_cli = False def test_rest_request( self, diff --git a/test/functional/rpc_whitelist.py b/test/functional/rpc_whitelist.py index da63b76df88..e14a591b682 100755 --- a/test/functional/rpc_whitelist.py +++ b/test/functional/rpc_whitelist.py @@ -33,7 +33,6 @@ class RPCWhitelistTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 - self.supports_cli = False def run_test(self): # 0 => Username diff --git a/test/functional/wallet_txn_clone.py b/test/functional/wallet_txn_clone.py index de9fe17ff23..f4ca1071411 100755 --- a/test/functional/wallet_txn_clone.py +++ b/test/functional/wallet_txn_clone.py @@ -17,7 +17,6 @@ from test_framework.messages import ( class TxnMallTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 3 - self.supports_cli = False self.extra_args = [[] for i in range(self.num_nodes)] def skip_test_if_missing_module(self):