File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,19 @@ def set_test_params(self):
83
83
def skip_test_if_missing_module (self ):
84
84
self .skip_if_no_cli ()
85
85
86
+ def test_netinfo (self ):
87
+ """Test -netinfo output format."""
88
+ self .log .info ("Test -netinfo header and separate local services line" )
89
+ out = self .nodes [0 ].cli ('-netinfo' ).send_cli ().splitlines ()
90
+ assert out [0 ].startswith (f"{ self .config ['environment' ]['CLIENT_NAME' ]} client " )
91
+ assert any (re .match (r"^Local services:.+network" , line ) for line in out )
92
+
93
+ self .log .info ("Test -netinfo local services are moved to header if details are requested" )
94
+ det = self .nodes [0 ].cli ('-netinfo' , '1' ).send_cli ().splitlines ()
95
+ self .log .debug (f"Test -netinfo 1 header output: { det [0 ]} " )
96
+ assert re .match (rf"^{ re .escape (self .config ['environment' ]['CLIENT_NAME' ])} client.+services nwl2?$" , det [0 ])
97
+ assert not any (line .startswith ("Local services:" ) for line in det )
98
+
86
99
def run_test (self ):
87
100
"""Main test logic"""
88
101
self .generate (self .nodes [0 ], BLOCKS )
@@ -379,6 +392,8 @@ def run_test(self):
379
392
self .log .info ("*** Wallet not compiled; cli getwalletinfo and -getinfo wallet tests skipped" )
380
393
self .generate (self .nodes [0 ], 25 ) # maintain block parity with the wallet_compiled conditional branch
381
394
395
+ self .test_netinfo ()
396
+
382
397
self .log .info ("Test -version with node stopped" )
383
398
self .stop_node (0 )
384
399
cli_response = self .nodes [0 ].cli ('-version' ).send_cli ()
You can’t perform that action at this time.
0 commit comments