File tree 1 file changed +26
-0
lines changed
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() {
317
317
}
318
318
}
319
319
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
+
320
346
/// Test that `over_ssh` errors if the source command has env vars specified.
321
347
#[ tokio:: test]
322
348
#[ cfg_attr( not( ci) , ignore) ]
You can’t perform that action at this time.
0 commit comments