File: agent.rs

package info (click to toggle)
rust-ssh2 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: sh: 37; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 362 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use ssh2::Session;

#[test]
fn smoke() {
    let sess = Session::new().unwrap();
    let mut agent = sess.agent().unwrap();
    agent.connect().unwrap();
    agent.list_identities().unwrap();
    {
        let a = agent.identities().unwrap();
        let i1 = &a[0];
        assert!(agent.userauth("foo", &i1).is_err());
    }
    agent.disconnect().unwrap();
}