diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-21 16:43:46 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-21 19:37:22 +0100 |
commit | d7b0258ff037ae90f60a86fc68cb55069c96e8d0 (patch) | |
tree | 0b8ac15c23276ad49cd10e6df59e92510cbab770 /test | |
parent | 16498860546e11b010a07bf49440aadf214bf5bf (diff) | |
parent | 3fb09b9889665a24b34f25e9d1385a05058a28b7 (diff) | |
download | bitcoin-d7b0258ff037ae90f60a86fc68cb55069c96e8d0.tar.xz |
Merge #14708: Warn unrecognised sections in the config file
3fb09b9889665a24b34f25e9d1385a05058a28b7 Warn unrecognized sections in the config file (Akio Nakamura)
Pull request description:
This PR intends to resolve #14702.
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-warning messages if unrecognized section names are
present in the config file after checking section only args.
note: Currentry, followings are out of scope of this PR.
1) Empty section name or option name can describe.
e.g. [] , .a=b, =c
2) Multiple period characters can exist in the section name and option name.
e.g. [c.d.e], [..], f.g.h.i=j, ..=k
Tree-SHA512: 2cea02a0525feb40320613989a75cd7b7b1bd12158d5e6f3174ca77e6a25bb84425dd8812f62483df9fc482045c7b5402d69bc714430518b1847d055a2dc304b
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_config_args.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ -34,6 +34,11 @@ class ConfArgsTest(BitcoinTestFramework): 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 def run_test(self): |