@@ -20,13 +20,16 @@ it.effect("preserves installed status after probes and cleans failed agent activ
2020 const home = yield * fs . makeTempDirectoryScoped ( ) ;
2121 const modes : string [ ] = [ ] ;
2222 const owners : string [ ] = [ ] ;
23+ const tunnelArgs : string [ ] [ ] = [ ] ;
24+ const commandArgs : string [ ] [ ] = [ ] ;
2325 let forwards = 0 ;
2426 let failForward = true ;
2527 let rejectConfig = true ;
2628 const spawner = ChildProcessSpawner . make ( ( command ) =>
2729 Effect . gen ( function * ( ) {
2830 if ( command . _tag !== "StandardCommand" ) return yield * Effect . die ( "Unexpected command" ) ;
2931 const forwarding = command . args . includes ( "-N" ) ;
32+ ( forwarding ? tunnelArgs : commandArgs ) . push ( [ ...command . args ] ) ;
3033 let output = "" ;
3134 if ( forwarding ) {
3235 if ( failForward ) {
@@ -132,6 +135,19 @@ it.effect("preserves installed status after probes and cleans failed agent activ
132135 expect ( ( yield * host . summary ) . agentDeviceInstalled ) . toBe ( true ) ;
133136 yield * host . stopAgent ;
134137 expect ( forwards ) . toBe ( 1 ) ;
138+ const multiplexingOff = [ "ControlMaster=no" , "ControlPath=none" , "ControlPersist=no" ] ;
139+ expect ( tunnelArgs . length ) . toBeGreaterThan ( 0 ) ;
140+ for ( const args of tunnelArgs ) {
141+ for ( const option of multiplexingOff ) {
142+ const index = args . indexOf ( option ) ;
143+ expect ( index ) . toBeGreaterThan ( 0 ) ;
144+ expect ( args [ index - 1 ] ) . toBe ( "-o" ) ;
145+ }
146+ }
147+ expect ( commandArgs . length ) . toBeGreaterThan ( 0 ) ;
148+ for ( const args of commandArgs ) {
149+ for ( const option of multiplexingOff ) expect ( args ) . not . toContain ( option ) ;
150+ }
135151 yield * host . stop ;
136152 expect ( forwards ) . toBe ( 0 ) ;
137153 } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
0 commit comments