From 3fb09b9889665a24b34f25e9d1385a05058a28b7 Mon Sep 17 00:00:00 2001 From: Akio Nakamura Date: Mon, 12 Nov 2018 11:06:36 +0900 Subject: Warn unrecognized sections in the config file In the config file, sections are specified by square bracket pair "[]"$, or included in the option name itself which separated by a period"(.)". Typicaly, [testnet] is not a correct section name and specified options in that section are ignored but user cannot recognize what is happen. So, add some log/stderr-warning messages if unrecognized section names are present in the config file after checking section only args. --- test/functional/feature_config_args.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py index 88a9aadc7b..d87eabaa6d 100755 --- a/test/functional/feature_config_args.py +++ b/test/functional/feature_config_args.py @@ -33,6 +33,11 @@ class ConfArgsTest(BitcoinTestFramework): conf.write('server=1\nrpcuser=someuser\nrpcpassword=some#pass') self.nodes[0].assert_start_raises_init_error(expected_msg='Error reading configuration file: parse error on line 3, using # in rpcpassword can be ambiguous and should be avoided') + with open(inc_conf_file_path, 'w', encoding='utf-8') as conf: + conf.write('testnot.datadir=1\n[testnet]\n') + self.restart_node(0) + self.nodes[0].stop_node(expected_stderr='Warning: Section [testnet] is not recognized.' + os.linesep + 'Warning: Section [testnot] is not recognized.') + with open(inc_conf_file_path, 'w', encoding='utf-8') as conf: conf.write('') # clear -- cgit v1.2.3