diff options
author | Wez Furlong <wez@wezfurlong.org> | 2020-02-22 08:22:02 -0800 |
---|---|---|
committer | Wez Furlong <wez@wezfurlong.org> | 2020-02-22 08:32:26 -0800 |
commit | e9ac51eee7070a4d2917a03260a83180e312726d (patch) | |
tree | 9657a488c7aab4f71827227c1706b423032fcf7d /tests | |
parent | 057083ebfd9b422d71bd6c836037e34072bcd32b (diff) | |
download | ssh2-rs-e9ac51eee7070a4d2917a03260a83180e312726d.zip |
Add Channel::request_auth_agent_forwarding
This method enables agent forwarding
Diffstat (limited to 'tests')
-rw-r--r-- | tests/all/channel.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/all/channel.rs b/tests/all/channel.rs index 2f14d01..75ece4e 100644 --- a/tests/all/channel.rs +++ b/tests/all/channel.rs @@ -45,6 +45,22 @@ fn smoke() { } #[test] +fn agent_forward() { + let sess = ::authed_session(); + let mut channel = sess.channel_session().unwrap(); + channel.request_auth_agent_forwarding().unwrap(); + channel.exec("echo $SSH_AUTH_SOCK").unwrap(); + + let (output, _) = consume_stdio(&mut channel); + let output = output.trim(); + // make sure that the sock is set + assert_ne!(output, ""); + // and that it isn't just inherited the one we set for this + // test environment + assert_ne!(output, std::env::var("SSH_AUTH_SOCK").unwrap()); +} + +#[test] fn bad_smoke() { let sess = ::authed_session(); let mut channel = sess.channel_session().unwrap(); |