Skip to content

Commit

Permalink
With agent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
131 committed Jul 8, 2019
1 parent a0f0540 commit 3998ad9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/test-client-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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();
});
});
});
});
Expand Down

0 comments on commit 3998ad9

Please sign in to comment.