File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,32 @@ async fn over_session_ok() {
317317 }
318318}
319319
320+
321+ #[ tokio:: test]
322+ #[ cfg_attr( not( ci) , ignore) ]
323+ async fn over_session_ok_require_escaping_arguments ( ) {
324+ for session in connects ( ) . await {
325+ let mut command = std:: process:: Command :: new ( "echo" )
326+ . arg ( "\" \' \' foo\' \' \" " )
327+ . over_ssh ( & session) . expect ( "No env vars or current working dir is set." ) ;
328+
329+ let child = command. output ( ) . await . unwrap ( ) ;
330+ assert_eq ! ( child. stdout, b"\" \' \' foo\' \' \" \n " ) ;
331+
332+ let child = session
333+ . command ( "echo" )
334+ . arg ( "foo" )
335+ . raw_arg ( ">" )
336+ . arg ( "/dev/stderr" )
337+ . output ( )
338+ . await
339+ . unwrap ( ) ;
340+ assert ! ( child. stdout. is_empty( ) ) ;
341+
342+ session. close ( ) . await . unwrap ( ) ;
343+ }
344+ }
345+
320346/// Test that `over_ssh` errors if the source command has env vars specified.
321347#[ tokio:: test]
322348#[ cfg_attr( not( ci) , ignore) ]
You can’t perform that action at this time.
0 commit comments