Skip to content

Commit 9030557

Browse files
committed
Test gArgs erroring on unknown args
1 parent 4f8704d commit 9030557

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/functional/feature_help.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ def run_test(self):
3636
output = self.nodes[0].process.stdout.read()
3737
assert b'version' in output
3838
self.log.info("Version text received: {} (...)".format(output[0:60]))
39+
40+
# Test that arguments not in the help results in an error
41+
self.log.info("Start bitcoind with -fakearg to make sure it does not start")
42+
self.nodes[0].start(extra_args=['-fakearg'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
43+
# Node should exit immediately and output an error to stderr
44+
ret_code = self.nodes[0].process.wait(timeout=1)
45+
assert_equal(ret_code, 1)
46+
output = self.nodes[0].process.stderr.read()
47+
assert b'Error parsing command line arguments' in output
48+
self.log.info("Error message received: {} (...)".format(output[0:60]))
49+
3950
# Clean up TestNode state
4051
self.nodes[0].running = False
4152
self.nodes[0].process = None

0 commit comments

Comments
 (0)