Skip to content

Commit

Permalink
Test gArgs erroring on unknown args
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed May 30, 2018
1 parent 4f8704d commit 9030557
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/functional/feature_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ def run_test(self):
output = self.nodes[0].process.stdout.read()
assert b'version' in output
self.log.info("Version text received: {} (...)".format(output[0:60]))

# Test that arguments not in the help results in an error
self.log.info("Start bitcoind with -fakearg to make sure it does not start")
self.nodes[0].start(extra_args=['-fakearg'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
# Node should exit immediately and output an error to stderr
ret_code = self.nodes[0].process.wait(timeout=1)
assert_equal(ret_code, 1)
output = self.nodes[0].process.stderr.read()
assert b'Error parsing command line arguments' in output
self.log.info("Error message received: {} (...)".format(output[0:60]))

# Clean up TestNode state
self.nodes[0].running = False
self.nodes[0].process = None
Expand Down

0 comments on commit 9030557

Please sign in to comment.