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):
8383 def skip_test_if_missing_module (self ):
8484 self .skip_if_no_cli ()
8585
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+
8699 def run_test (self ):
87100 """Main test logic"""
88101 self .generate (self .nodes [0 ], BLOCKS )
@@ -379,6 +392,8 @@ def run_test(self):
379392 self .log .info ("*** Wallet not compiled; cli getwalletinfo and -getinfo wallet tests skipped" )
380393 self .generate (self .nodes [0 ], 25 ) # maintain block parity with the wallet_compiled conditional branch
381394
395+ self .test_netinfo ()
396+
382397 self .log .info ("Test -version with node stopped" )
383398 self .stop_node (0 )
384399 cli_response = self .nodes [0 ].cli ('-version' ).send_cli ()
You can’t perform that action at this time.
0 commit comments