From 2ad3689512a36eaff957df9ac28e65b2fedbc36c Mon Sep 17 00:00:00 2001 From: tdb3 <106488469+tdb3@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:57:27 -0400 Subject: [PATCH] test: add norpcauth test Adds test for disabling rpcauth args. Co-Authored-By: Luke Dashjr --- test/functional/rpc_users.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py index 3fe4b7c5183..c5c9d3c86c4 100755 --- a/test/functional/rpc_users.py +++ b/test/functional/rpc_users.py @@ -159,6 +159,12 @@ class HTTPBasicsTest(BitcoinTestFramework): self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=[rpcauth_user1, '-rpcauth=', rpcauth_user2]) self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=', rpcauth_user1, rpcauth_user2]) + self.log.info('Check -norpcauth disables previous -rpcauth params') + self.restart_node(0, extra_args=[rpcauth_user1, rpcauth_user2, '-norpcauth']) + assert_equal(401, call_with_auth(self.nodes[0], 'user1', 'bitcoin').status) + assert_equal(401, call_with_auth(self.nodes[0], 'rt', self.rtpassword).status) + self.stop_node(0) + self.log.info('Check that failure to write cookie file will abort the node gracefully') (self.nodes[0].chain_path / ".cookie.tmp").mkdir() self.nodes[0].assert_start_raises_init_error(expected_msg=init_error)