Currently it's possible to accidentally type e.g.
bitcoin-cli -getinfo getbalance
and get an answer which can be confusing; the trailing arguments are just ignored.
To avoid this, throw an error if the user provides arguments to
-getinfo.
Currently it's possible to accidentally type e.g.
bitcoin-cli -getinfo getbalance
and get an answer which can be confusing; the trailing arguments are just ignored.
To avoid this, throw an error if the user provides arguments to
-getinfo.
Travis failure:
bitcoin_cli.py failed, Duration: 1 s
stdout:
2017-11-17 13:47:24.232000 TestFramework (INFO): Initializing test directory /tmp/bitcoin_test_runner_20171117_134443/bitcoin_cli_303
2017-11-17 13:47:24.492000 TestFramework (INFO): Compare responses from gewalletinfo RPC and `bitcoin-cli getwalletinfo`
2017-11-17 13:47:24.503000 TestFramework (INFO): Compare responses from getblockchaininfo RPC and `bitcoin-cli getblockchaininfo`
2017-11-17 13:47:24.509000 TestFramework (INFO): Test -stdinrpcpass option
2017-11-17 13:47:24.768000 TestFramework (INFO): Test -stdin and -stdinrpcpass
2017-11-17 13:47:25.030000 TestFramework (INFO): Compare responses from `bitcoin-cli -getinfo` and the RPCs data is retrieved from.
2017-11-17 13:47:25.041000 TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 120, in main
self.run_test()
File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-i686-pc-linux-gnu/test/functional/bitcoin_cli.py", line 39, in run_test
cli_get_info = self.nodes[0].cli('-getinfo').help()
File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_node.py", line 211, in dispatcher
return self.send_cli(command, *args, **kwargs)
File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_node.py", line 229, in send_cli
raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr)
subprocess.CalledProcessError: Command '/home/travis/build/bitcoin/bitcoin/build/bitcoin-i686-pc-linux-gnu/src/bitcoin-cli' returned non-zero exit status 1
2017-11-17 13:47:25.042000 TestFramework (INFO): Stopping nodes
Strange! Seems a legit error. Will look at it.
Ah, yes, the test seems to test something that should be failing:
cli_get_info = self.nodes[0].cli('-getinfo').help()
Will execute
bitcoin-cli -getinfo help
Which makes no sense :) Will update the test.
Currently it's possible to accidentally type e.g.
bitcoin-cli -getinfo getbalance
and get an answer which can be confusing; the trialing arguments are
just ignored.
To avoid this, throw an error if the user provides arguments to
`-getinfo`.Updated the test, now it tests both cases correctly, travis issue should be solved.
34 | @@ -35,8 +35,11 @@ def run_test(self): 35 | assert_equal(["foo", "bar"], self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input=password + "\nfoo\nbar").echo()) 36 | assert_raises_process_error(1, "incorrect rpcuser or rpcpassword", self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input="foo").echo) 37 | 38 | + self.log.info("Make sure that -getinfo with arguments fails") 39 | + assert_raises_process_error(1, "-getinfo takes no arguments", self.nodes[0].cli('-getinfo').help)
👍
utACK dcfef27.
Tested ACK dcfef277b4920552f438c110390a5de93892a8de
utACK dcfef277b4920552f438c110390a5de93892a8de