-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ var crypto = require('crypto'); | |
var path = require('path'); | ||
var join = path.join; | ||
var inspect = require('util').inspect; | ||
var cp = require('child_process'); | ||
var assert = require('assert'); | ||
|
||
var t = -1; | ||
|
@@ -922,17 +923,20 @@ var tests = [ | |
var server; | ||
var r; | ||
var out = ''; | ||
var agent; | ||
var agent_sock = '/tmp/foobar'; | ||
|
||
r = setup( | ||
this, | ||
{ username: USER, | ||
password: PASSWORD, | ||
agent: '/foo/bar/baz' | ||
agent: agent_sock, | ||
}, | ||
{ hostKeys: [HOST_KEY_RSA] } | ||
); | ||
client = r.client; | ||
server = r.server; | ||
agent = cp.spawn('ssh-agent', ['-d', '-a', agent_sock]); | ||
|
||
server.on('connection', function(conn) { | ||
conn.on('authentication', function(ctx) { | ||
|
@@ -951,7 +955,15 @@ var tests = [ | |
stream.write(inspect(authAgentReq)); | ||
stream.exit(100); | ||
stream.end(); | ||
conn.end(); | ||
|
||
conn.openssh_authAgent(function(err, stream) { | ||
assert(!err, makeMsg('Unexpected openssh_authAgent error: ' + err)); | ||
assert(stream.type === '[email protected]', | ||
makeMsg('Unexpected openssh_authAgent channel type : ' + stream.type)); | ||
|
||
conn.end(); | ||
agent && agent.kill(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|