File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -828,6 +828,8 @@ async fn local_socket_forward() {
828828async fn test_sftp_subsystem ( ) {
829829 use openssh_sftp_client:: highlevel:: Sftp ;
830830
831+ let content = b"Helop, world!\n " ;
832+
831833 for session in connects ( ) . await {
832834 let mut child = session
833835 . subsystem ( "sftp" )
@@ -837,15 +839,23 @@ async fn test_sftp_subsystem() {
837839 . await
838840 . unwrap ( ) ;
839841
840- Sftp :: new (
842+ let sftp = Sftp :: new (
841843 child. stdin ( ) . take ( ) . unwrap ( ) ,
842844 child. stdout ( ) . take ( ) . unwrap ( ) ,
843845 Default :: default ( ) ,
844846 )
845847 . await
846- . unwrap ( )
847- . close ( )
848- . await
849848 . unwrap ( ) ;
849+
850+ let file_path = "/tmp/file" ;
851+
852+ {
853+ let mut fs = sftp. fs ( ) ;
854+
855+ fs. write ( file_path, content) . await . unwrap ( ) ;
856+ assert_eq ! ( & * sftp. fs( ) . read( file_path) . await . unwrap( ) , content) ;
857+ }
858+
859+ sftp. close ( ) . await . unwrap ( ) ;
850860 }
851861}
You can’t perform that action at this time.
0 commit comments