Browse Source

test: Don't fail tls-session-cache if openssl is bad

v0.10.0-release
isaacs 12 years ago
parent
commit
6d593a9026
  1. 23
      test/simple/test-tls-session-cache.js

23
test/simple/test-tls-session-cache.js

@ -51,6 +51,7 @@ function doTest() {
}; };
var requestCount = 0; var requestCount = 0;
var session; var session;
var badOpenSSL = false;
var server = tls.createServer(options, function(cleartext) { var server = tls.createServer(options, function(cleartext) {
cleartext.on('error', function(er) { cleartext.on('error', function(er) {
@ -88,18 +89,30 @@ function doTest() {
'-reconnect', '-reconnect',
'-no_ticket' '-no_ticket'
], { ], {
customFds: [0, 1, 2] stdio: [ 0, 1, 'pipe' ]
});
var err = '';
client.stderr.setEncoding('utf8');
client.stderr.on('data', function(chunk) {
err += chunk;
}); });
client.on('exit', function(code) { client.on('exit', function(code) {
assert.equal(code, 0); if (/^unknown option/.test(err)) {
// using an incompatible version of openssl
assert(code);
badOpenSSL = true;
} else
assert.equal(code, 0);
server.close(); server.close();
}); });
}); });
process.on('exit', function() { process.on('exit', function() {
assert.ok(session); if (!badOpenSSL) {
assert.ok(session);
// initial request + reconnect requests (5 times) // initial request + reconnect requests (5 times)
assert.equal(requestCount, 6); assert.equal(requestCount, 6);
}
}); });
} }

Loading…
Cancel
Save