rpcwhitelist: add feature test
This commit is contained in:
parent
1bf45a9547
commit
21c0fb440d
@ -7,6 +7,15 @@ succeed('[[ $(stat -c "%U:%G %a" /secrets/dummy) = "root:root 440" ]]')
|
||||
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
|
||||
machine.fail(
|
||||
"bitcoin-cli -rpcuser=publicrpc -rpcpassword=$(cat /secrets/bitcoin-rpcpassword-public) help"
|
||||
)
|
||||
machine.wait_until_succeeds(
|
||||
log_has_string("bitcoind", "RPC User publicrpc not allowed to call method help")
|
||||
)
|
||||
|
||||
assert_running("electrs")
|
||||
machine.wait_for_open_port(4224) # prometeus metrics provider
|
||||
|
@ -19,6 +19,15 @@ succeed('[[ $(stat -c "%U:%G %a" /secrets/dummy) = "root:root 440" ]]')
|
||||
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
|
||||
machine.fail(
|
||||
"bitcoin-cli -rpcuser=publicrpc -rpcpassword=$(cat /secrets/bitcoin-rpcpassword-public) help"
|
||||
)
|
||||
machine.wait_until_succeeds(
|
||||
log_has_string("bitcoind", "RPC User publicrpc not allowed to call method help")
|
||||
)
|
||||
|
||||
assert_running("electrs")
|
||||
machine.wait_until_succeeds(
|
||||
|
Loading…
Reference in New Issue
Block a user