Skip to content

Commit b4432de

Browse files
committed
Impl test_sftp_subsystem
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
1 parent a340328 commit b4432de

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/openssh.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,3 +822,31 @@ async fn local_socket_forward() {
822822
assert!(output.status.success());
823823
}
824824
}
825+
826+
#[cfg(feature = "openssh-sftp-client")]
827+
#[tokio::test]
828+
#[cfg_attr(not(ci), ignore)]
829+
async fn test_sftp_subsystem() {
830+
use openssh_sftp_client::highlevel::Sftp;
831+
832+
for session in connects().await {
833+
let mut child = session
834+
.subsystem("sftp")
835+
.stdin(Stdio::piped())
836+
.stdout(Stdio::piped())
837+
.spawn()
838+
.await
839+
.unwrap();
840+
841+
Sftp::new(
842+
child.stdin().take().unwrap(),
843+
child.stdout().take().unwrap(),
844+
Default::default(),
845+
)
846+
.await
847+
.unwrap()
848+
.close()
849+
.await
850+
.unwrap();
851+
}
852+
}

0 commit comments

Comments
 (0)