diff options
author | Jon Atack <jon@atack.com> | 2023-05-12 00:58:56 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2023-06-14 08:27:46 -0600 |
commit | 25478292726dd7208b22a8924c8f1fdeac5c33f5 (patch) | |
tree | 7956cffbc9df28731a82f740239ae47e0e246d47 | |
parent | a9c295888b82c86ef4629aa2d9061ea152b48f20 (diff) |
test: -loglevel raises on invalid values
-rwxr-xr-x | test/functional/feature_logging.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/feature_logging.py b/test/functional/feature_logging.py index a33aa043f8..b0788e2a2d 100755 --- a/test/functional/feature_logging.py +++ b/test/functional/feature_logging.py @@ -82,6 +82,23 @@ class LoggingTest(BitcoinTestFramework): match=ErrorMatch.FULL_REGEX, ) + self.log.info("Test -loglevel raises when invalid values are passed") + self.nodes[0].assert_start_raises_init_error( + extra_args=["-loglevel=abc"], + expected_msg="Error: Unsupported global logging level -loglevel=abc. Valid values: info, debug, trace.", + match=ErrorMatch.FULL_REGEX, + ) + self.nodes[0].assert_start_raises_init_error( + extra_args=["-loglevel=net:abc"], + expected_msg="Error: Unsupported category-specific logging level -loglevel=net:abc.", + match=ErrorMatch.PARTIAL_REGEX, + ) + self.nodes[0].assert_start_raises_init_error( + extra_args=["-loglevel=net:info:abc"], + expected_msg="Error: Unsupported category-specific logging level -loglevel=net:info:abc.", + match=ErrorMatch.PARTIAL_REGEX, + ) + if __name__ == '__main__': LoggingTest().main() |