Skip to content

Commit becc8b9

Browse files
committed
test: verify bitcoin-cli -version with node stopped
in interface_bitcoin_cli.py and improve/harmonize the test logging.
1 parent 727b67e commit becc8b9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/functional/interface_bitcoin_cli.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ def run_test(self):
2525
"""Main test logic"""
2626
self.nodes[0].generate(BLOCKS)
2727

28-
cli_response = self.nodes[0].cli("-version").send_cli()
29-
assert "{} RPC client version".format(self.config['environment']['PACKAGE_NAME']) in cli_response
30-
31-
self.log.info("Compare responses from getwalletinfo RPC and `bitcoin-cli getwalletinfo`")
3228
if self.is_wallet_compiled():
29+
self.log.info("Compare responses from getwalletinfo RPC and `bitcoin-cli getwalletinfo`")
3330
cli_response = self.nodes[0].cli.getwalletinfo()
3431
rpc_response = self.nodes[0].getwalletinfo()
3532
assert_equal(cli_response, rpc_response)
@@ -55,10 +52,10 @@ def run_test(self):
5552
self.log.info("Test connecting with non-existing RPC cookie file")
5653
assert_raises_process_error(1, "Could not locate RPC credentials", self.nodes[0].cli('-rpccookiefile=does-not-exist', '-rpcpassword=').echo)
5754

58-
self.log.info("Make sure that -getinfo with arguments fails")
55+
self.log.info("Test -getinfo with arguments fails")
5956
assert_raises_process_error(1, "-getinfo takes no arguments", self.nodes[0].cli('-getinfo').help)
6057

61-
self.log.info("Test that -getinfo returns the expected network and blockchain info")
58+
self.log.info("Test -getinfo returns expected network and blockchain info")
6259
cli_get_info = self.nodes[0].cli('-getinfo').send_cli()
6360
network_info = self.nodes[0].getnetworkinfo()
6461
blockchain_info = self.nodes[0].getblockchaininfo()
@@ -72,7 +69,7 @@ def run_test(self):
7269
assert_equal(cli_get_info['chain'], blockchain_info['chain'])
7370

7471
if self.is_wallet_compiled():
75-
self.log.info("Test that -getinfo returns the expected wallet info")
72+
self.log.info("Test -getinfo returns expected wallet info")
7673
assert_equal(cli_get_info['balance'], BALANCE)
7774
wallet_info = self.nodes[0].getwalletinfo()
7875
assert_equal(cli_get_info['keypoolsize'], wallet_info['keypoolsize'])
@@ -84,6 +81,10 @@ def run_test(self):
8481

8582
self.stop_node(0)
8683

84+
self.log.info("Test -version with node stopped")
85+
cli_response = self.nodes[0].cli("-version").send_cli()
86+
assert "{} RPC client version".format(self.config['environment']['PACKAGE_NAME']) in cli_response
87+
8788
self.log.info("Test -rpcwait option waits for RPC connection instead of failing")
8889
# Start node without RPC connection.
8990
self.nodes[0].start()

0 commit comments

Comments
 (0)