test: add cases for blank rpcauth

This commit is contained in:
tdb3 2024-08-06 13:14:08 -04:00
parent 2aff9a36c3
commit ecc98ccff2
No known key found for this signature in database

View file

@ -139,9 +139,11 @@ class HTTPBasicsTest(BitcoinTestFramework):
init_error = 'Error: Unable to start HTTP server. See debug log for details.'
self.log.info('Check -rpcauth are validated')
# Empty -rpcauth= are ignored
self.log.info('Empty -rpcauth are ignored')
self.restart_node(0, extra_args=['-rpcauth'])
self.restart_node(0, extra_args=['-rpcauth='])
self.stop_node(0)
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=""'])
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo'])
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo:bar'])
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo:bar:baz'])