Skip to content

Commit

Permalink
test: refactor test-tls-ecdh-disable
Browse files Browse the repository at this point in the history
* use common.mustCall()
* use String.prototype.includes() instead of String.prototype.indexOf()

PR-URL: #9989
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Aaron Williams authored and cjihrig committed Dec 20, 2016
1 parent b26fe48 commit 3c2d803
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-tls-ecdh-disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ var options = {

var server = tls.createServer(options, common.fail);

server.listen(0, '127.0.0.1', function() {
server.listen(0, '127.0.0.1', common.mustCall(function() {
var cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers +
` -connect 127.0.0.1:${this.address().port}`;

// for the performance and stability issue in s_client on Windows
if (common.isWindows)
cmd += ' -no_rand_screen';

exec(cmd, function(err, stdout, stderr) {
exec(cmd, common.mustCall(function(err, stdout, stderr) {
// Old versions of openssl will still exit with 0 so we
// can't just check if err is not null.
assert.notEqual(stderr.indexOf('handshake failure'), -1);
assert(stderr.includes('handshake failure'));
server.close();
});
});
}));
}));

0 comments on commit 3c2d803

Please sign in to comment.