From 25478292726dd7208b22a8924c8f1fdeac5c33f5 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Fri, 12 May 2023 00:58:56 +0200 Subject: test: -loglevel raises on invalid values --- test/functional/feature_logging.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/functional') 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() -- cgit v1.2.3