summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/all/channel.rs21
-rwxr-xr-xtests/run_integration_tests.sh2
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/all/channel.rs b/tests/all/channel.rs
index 660c72d..8b624ac 100644
--- a/tests/all/channel.rs
+++ b/tests/all/channel.rs
@@ -220,3 +220,24 @@ fn exit_code_ignores_other_errors() {
assert!(sess.disconnect(None, &longdescription, None).is_err()); // max len == 256
assert!(channel.exit_status().unwrap() == 0);
}
+
+#[test]
+fn pty_modes_are_propagated() {
+ let sess = ::authed_session();
+ let mut channel = sess.channel_session().unwrap();
+ eprintln!("requesting pty");
+
+ let mut mode = ssh2::PtyModes::new();
+ // intr is typically CTRL-C; setting it to unmodified `y`
+ // should be very high signal that it took effect
+ mode.set_character(ssh2::PtyModeOpcode::VINTR, Some('y'));
+
+ channel.request_pty("xterm", Some(mode), None).unwrap();
+ channel.exec("stty -a").unwrap();
+
+ let (out, _err) = consume_stdio(&mut channel);
+ channel.close().unwrap();
+
+ // This may well be linux specific
+ assert!(out.contains("intr = y"), "mode was propagated");
+}
diff --git a/tests/run_integration_tests.sh b/tests/run_integration_tests.sh
index 451fbec..02d132d 100755
--- a/tests/run_integration_tests.sh
+++ b/tests/run_integration_tests.sh
@@ -31,7 +31,7 @@ cp $SSHDIR/id_rsa.pub $SSHDIR/authorized_keys
ssh-keygen -f $SSHDIR/ssh_host_rsa_key -N '' -t rsa
-for p in /usr/lib/openssh/sftp-server /usr/libexec/sftp-server ; do
+for p in /usr/lib/openssh/sftp-server /usr/libexec/sftp-server /usr/libexec/openssh/sftp-server ; do
if test -x $p ; then
SFTP=$p
fi