From 4d6127bb7684291fe52647a0e2c838af60ad63f7 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 27 Aug 2020 12:17:39 +0200 Subject: [PATCH] bitcoind: clarify RPC whitelist test - Remove redundant comment - Test with obviously unsafe RPC call 'stop' - No need to test privileged user who has no whitelist --- test/base.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/base.py b/test/base.py index c35d380..0e72de3 100644 --- a/test/base.py +++ b/test/base.py @@ -46,14 +46,12 @@ def run_tests(extra_tests): assert_running("bitcoind") machine.wait_until_succeeds("bitcoin-cli getnetworkinfo") assert_matches("su operator -c 'bitcoin-cli getnetworkinfo' | jq", '"version"') - # Test RPC Whitelist - machine.wait_until_succeeds("su operator -c 'bitcoin-cli help'") - # Restating rpcuser & rpcpassword overrides privileged credentials + # RPC access for user 'public' should be restricted machine.fail( - "bitcoin-cli -rpcuser=public -rpcpassword=$(cat /secrets/bitcoin-rpcpassword-public) help" + "bitcoin-cli -rpcuser=public -rpcpassword=$(cat /secrets/bitcoin-rpcpassword-public) stop" ) machine.wait_until_succeeds( - log_has_string("bitcoind", "RPC User public not allowed to call method help") + log_has_string("bitcoind", "RPC User public not allowed to call method stop") ) assert_running("electrs")