aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_logging.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/feature_logging.py')
-rwxr-xr-xtest/functional/feature_logging.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/feature_logging.py b/test/functional/feature_logging.py
index fe4f02dfe6..b0788e2a2d 100755
--- a/test/functional/feature_logging.py
+++ b/test/functional/feature_logging.py
@@ -69,6 +69,36 @@ class LoggingTest(BitcoinTestFramework):
# just sanity check no crash here
self.restart_node(0, [f"-debuglogfile={os.devnull}"])
+ self.log.info("Test -debug and -debugexclude raise when invalid values are passed")
+ self.stop_node(0)
+ self.nodes[0].assert_start_raises_init_error(
+ extra_args=["-debug=abc"],
+ expected_msg="Error: Unsupported logging category -debug=abc.",
+ match=ErrorMatch.FULL_REGEX,
+ )
+ self.nodes[0].assert_start_raises_init_error(
+ extra_args=["-debugexclude=abc"],
+ expected_msg="Error: Unsupported logging category -debugexclude=abc.",
+ 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()