Test that starting bitcoind/bitcoin-qt with -h
and -version
works as expected.
Prompted by #10762#commitcomment-28345993, which is a nullpointer dereference triggered by starting bitcoin-qt with -h
.
On master, this test passes when run over bitcoind, but fails when running over bitcoin-qt. I used xvfb as a virtual frame buffer to test:
0BITCOIND=/home/ubuntu/bitcoin/src/qt/bitcoin-qt xvfb-run ./feature_help.py --nocleanup
12018-03-30T17:09:37.767000Z TestFramework (INFO): Initializing test directory /tmp/user/1000/testdi4dre13
22018-03-30T17:09:37.767000Z TestFramework (INFO): Start bitcoin with -h for help text
32018-03-30T17:09:37.841000Z TestFramework (ERROR): Assertion failed
4Traceback (most recent call last):
5 File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 126, in main
6 self.run_test()
7 File "./feature_help.py", line 25, in run_test
8 assert_equal(ret_code, 0)
9 File "/home/ubuntu/bitcoin/test/functional/test_framework/util.py", line 39, in assert_equal
10 raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
11AssertionError: not(-11 == 0)
122018-03-30T17:09:37.842000Z TestFramework (INFO): Stopping nodes
13Traceback (most recent call last):
14 File "./feature_help.py", line 42, in <module>
15 HelpTest().main()
16 File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 149, in main
17 self.stop_nodes()
18 File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 273, in stop_nodes
19 node.stop_node()
20 File "/home/ubuntu/bitcoin/test/functional/test_framework/test_node.py", line 141, in stop_node
21 self.stop()
22 File "/home/ubuntu/bitcoin/test/functional/test_framework/test_node.py", line 87, in __getattr__
23 assert self.rpc_connected and self.rpc is not None, "Error: no RPC connection"
24AssertionError: Error: no RPC connection
Passes for bitcoind and bitcoin-qt when run on #12836.
Longer term, we should consider running functional tests over bitcoin-qt in one of the Travis jobs.