aboutsummaryrefslogtreecommitdiff
path: root/test/functional/interface_bitcoin_cli.py
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-04-15 15:03:28 +0200
committerJon Atack <jon@atack.com>2020-04-15 16:39:42 +0200
commit727b67e7b86567adff81d945044989de3b5d2d5f (patch)
treea7be243e2580e0cfe68ba95d4a8d54a6a1ba35c7 /test/functional/interface_bitcoin_cli.py
parent20c0e2e0f04f699d29419d52696601b76eca3124 (diff)
downloadbitcoin-727b67e7b86567adff81d945044989de3b5d2d5f.tar.xz
test: add coverage for bitcoin-cli -rpcwait
in interface_bitcoin_cli.py
Diffstat (limited to 'test/functional/interface_bitcoin_cli.py')
-rwxr-xr-xtest/functional/interface_bitcoin_cli.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/interface_bitcoin_cli.py b/test/functional/interface_bitcoin_cli.py
index 2e1e84b707..6077810a71 100755
--- a/test/functional/interface_bitcoin_cli.py
+++ b/test/functional/interface_bitcoin_cli.py
@@ -70,6 +70,7 @@ class TestBitcoinCli(BitcoinTestFramework):
assert_equal(cli_get_info['proxy'], network_info['networks'][0]['proxy'])
assert_equal(cli_get_info['difficulty'], blockchain_info['difficulty'])
assert_equal(cli_get_info['chain'], blockchain_info['chain'])
+
if self.is_wallet_compiled():
self.log.info("Test that -getinfo returns the expected wallet info")
assert_equal(cli_get_info['balance'], BALANCE)
@@ -81,6 +82,17 @@ class TestBitcoinCli(BitcoinTestFramework):
else:
self.log.info("*** Wallet not compiled; -getinfo wallet tests skipped")
+ self.stop_node(0)
+
+ self.log.info("Test -rpcwait option waits for RPC connection instead of failing")
+ # Start node without RPC connection.
+ self.nodes[0].start()
+ # Verify failure without -rpcwait.
+ assert_raises_process_error(1, "Could not connect to the server", self.nodes[0].cli('getblockcount').echo)
+ # Verify success using -rpcwait.
+ assert_equal(BLOCKS, self.nodes[0].cli('-rpcwait', 'getblockcount').send_cli())
+ self.nodes[0].wait_for_rpc_connection()
+
if __name__ == '__main__':
TestBitcoinCli().main()