Skip to content

Commit 2ad3689

Browse files
tdb3luke-jr
andcommitted
test: add norpcauth test
Adds test for disabling rpcauth args. Co-Authored-By: Luke Dashjr <[email protected]>
1 parent 67df0de commit 2ad3689

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/rpc_users.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ def run_test(self):
159159
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=[rpcauth_user1, '-rpcauth=', rpcauth_user2])
160160
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=', rpcauth_user1, rpcauth_user2])
161161

162+
self.log.info('Check -norpcauth disables previous -rpcauth params')
163+
self.restart_node(0, extra_args=[rpcauth_user1, rpcauth_user2, '-norpcauth'])
164+
assert_equal(401, call_with_auth(self.nodes[0], 'user1', 'bitcoin').status)
165+
assert_equal(401, call_with_auth(self.nodes[0], 'rt', self.rtpassword).status)
166+
self.stop_node(0)
167+
162168
self.log.info('Check that failure to write cookie file will abort the node gracefully')
163169
(self.nodes[0].chain_path / ".cookie.tmp").mkdir()
164170
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error)

0 commit comments

Comments
 (0)