From e55ea534f74b2dd2a81e8f9972554303f7cf9c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Fri, 16 Jan 2026 21:25:15 +0100 Subject: [PATCH] test: add pre-`LogPeer` net log assertion Assert net log output contains `peer=... peeraddr=...` before the comma change. --- test/functional/feature_logging.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/feature_logging.py b/test/functional/feature_logging.py index b04cd48c7e6..5a4ef515fb0 100755 --- a/test/functional/feature_logging.py +++ b/test/functional/feature_logging.py @@ -7,6 +7,7 @@ import os from test_framework.test_framework import BitcoinTestFramework +from test_framework.p2p import P2PInterface from test_framework.test_node import ErrorMatch @@ -115,5 +116,12 @@ class LoggingTest(BitcoinTestFramework): assert logging['rpc'] assert logging['net'] + self.log.info("Test -logips formatting in net logs") + self.restart_node(0, ['-debug=net', '-logips=1']) + with self.nodes[0].assert_debug_log(["peer=0 peeraddr="]): + p2p = self.nodes[0].add_p2p_connection(P2PInterface()) + p2p.wait_for_verack() + self.nodes[0].disconnect_p2ps() + if __name__ == '__main__': LoggingTest(__file__).main()