Skip to content

Commit ea45967

Browse files
author
MarcoFalke
committed
Merge #16234: test: Add test for unknown args
fa7dd88 test: Add test for unknown args (MarcoFalke) Pull request description: Currently uncovered. Further reading: * https://marcofalke.github.io/btc_cov/total.coverage/src/util/system.cpp.gcov.html * Fail on unknown config file options #15021 ACKs for commit fa7dd8: promag: ACK fa7dd88, tests looks good to me. hebasto: ACK fa7dd88, I have tested the code. Tree-SHA512: 86ab370ce8e85925f945a52e81457b5678d71bbabcef01205a97782b780003f363552e0bad1ff678bccc784f82c6b511c3b88de3f8f25f62b0b713c387950564
2 parents 9c95515 + fa7dd88 commit ea45967

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/functional/feature_config_args.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ def test_config_file_parser(self):
2121
with open(os.path.join(self.nodes[0].datadir, 'bitcoin.conf'), 'a', encoding='utf-8') as conf:
2222
conf.write('includeconf={}\n'.format(inc_conf_file_path))
2323

24+
self.nodes[0].assert_start_raises_init_error(
25+
expected_msg='Error parsing command line arguments: Invalid parameter -dash_cli',
26+
extra_args=['-dash_cli=1'],
27+
)
28+
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
29+
conf.write('dash_conf=1\n')
30+
with self.nodes[0].assert_debug_log(expected_msgs=['Ignoring unknown configuration value dash_conf']):
31+
self.start_node(0)
32+
self.stop_node(0)
33+
2434
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
2535
conf.write('-dash=1\n')
2636
self.nodes[0].assert_start_raises_init_error(expected_msg='Error reading configuration file: parse error on line 1: -dash=1, options in configuration file must be specified without leading -')

0 commit comments

Comments
 (0)