diff options
author | Andrew Chow <achow101-github@achow101.com> | 2018-04-28 23:13:56 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2018-05-30 11:27:50 -0400 |
commit | 903055730b57ae7c8d12aca2e3fd0951f12f7e9c (patch) | |
tree | 3dea8712af250bf73df972a979e85cca1b0a054f | |
parent | 4f8704d57f8fb2958a43534779b20201b77eecae (diff) |
Test gArgs erroring on unknown args
-rwxr-xr-x | test/functional/feature_help.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/feature_help.py b/test/functional/feature_help.py index fd4a72f628..d38275a9ca 100755 --- a/test/functional/feature_help.py +++ b/test/functional/feature_help.py @@ -36,6 +36,17 @@ class HelpTest(BitcoinTestFramework): 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 |