diff --git a/test/parallel/test-regress-GH-node-9326.js b/test/parallel/test-kill-segfault-freebsd.js similarity index 61% rename from test/parallel/test-regress-GH-node-9326.js rename to test/parallel/test-kill-segfault-freebsd.js index 78565e3f596594..8532f11c86b804 100644 --- a/test/parallel/test-regress-GH-node-9326.js +++ b/test/parallel/test-kill-segfault-freebsd.js @@ -1,5 +1,10 @@ 'use strict'; require('../common'); + +// This test ensures Node.js doesn't crash on hitting Ctrl+C in order to +// terminate the currently running process (especially on FreeBSD). +// https://github.com/nodejs/node-v0.x-archive/issues/9326 + const assert = require('assert'); const child_process = require('child_process'); diff --git a/test/parallel/test-regress-GH-io-1068.js b/test/parallel/test-regress-GH-io-1068.js deleted file mode 100644 index a92bb3e75259f0..00000000000000 --- a/test/parallel/test-regress-GH-io-1068.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; -require('../common'); -process.stdin.emit('end'); diff --git a/test/parallel/test-timers-regress-GH-9765.js b/test/parallel/test-timers-setimmediate-infinite-loop.js similarity index 100% rename from test/parallel/test-timers-regress-GH-9765.js rename to test/parallel/test-timers-setimmediate-infinite-loop.js diff --git a/test/parallel/test-tls-pfx-authorizationerror.js b/test/parallel/test-tls-pfx-authorizationerror.js new file mode 100644 index 00000000000000..64b6e1485dc538 --- /dev/null +++ b/test/parallel/test-tls-pfx-authorizationerror.js @@ -0,0 +1,42 @@ +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('node compiled without crypto.'); +const fixtures = require('../common/fixtures'); + +// This test ensures that TLS does not fail to read a self-signed certificate +// and thus throw an `authorizationError`. +// https://github.com/nodejs/node/issues/5100 + +const assert = require('assert'); +const tls = require('tls'); + +const pfx = fixtures.readKey('agent1-pfx.pem'); + +const server = tls + .createServer( + { + pfx: pfx, + passphrase: 'sample', + requestCert: true, + rejectUnauthorized: false + }, + common.mustCall(function(c) { + assert.strictEqual(c.authorizationError, null); + c.end(); + }) + ) + .listen(0, function() { + const client = tls.connect( + { + port: this.address().port, + pfx: pfx, + passphrase: 'sample', + rejectUnauthorized: false + }, + function() { + client.end(); + server.close(); + } + ); + }); diff --git a/test/parallel/test-tls-pfx-gh-5100-regr.js b/test/parallel/test-tls-pfx-gh-5100-regr.js deleted file mode 100644 index 199d4bdf22778c..00000000000000 --- a/test/parallel/test-tls-pfx-gh-5100-regr.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const common = require('../common'); - -if (!common.hasCrypto) - common.skip('node compiled without crypto.'); - -const assert = require('assert'); -const tls = require('tls'); -const fixtures = require('../common/fixtures'); - -const pfx = fixtures.readKey('agent1-pfx.pem'); - -const server = tls.createServer({ - pfx: pfx, - passphrase: 'sample', - requestCert: true, - rejectUnauthorized: false -}, common.mustCall(function(c) { - assert.strictEqual(c.authorizationError, null); - c.end(); -})).listen(0, function() { - const client = tls.connect({ - port: this.address().port, - pfx: pfx, - passphrase: 'sample', - rejectUnauthorized: false - }, function() { - client.end(); - server.close(); - }); -}); diff --git a/test/parallel/test-tls-regr-gh-5108.js b/test/parallel/test-tls-tlswrap-segfault.js similarity index 81% rename from test/parallel/test-tls-regr-gh-5108.js rename to test/parallel/test-tls-tlswrap-segfault.js index 402a6014d1396c..eaa51ff51baa71 100644 --- a/test/parallel/test-tls-regr-gh-5108.js +++ b/test/parallel/test-tls-tlswrap-segfault.js @@ -1,19 +1,21 @@ 'use strict'; const common = require('../common'); - if (!common.hasCrypto) common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); + +// This test ensures that Node.js doesn't incur a segfault while accessing +// TLSWrap fields after the parent handle was destroyed. +// https://github.com/nodejs/node/issues/5108 const assert = require('assert'); const tls = require('tls'); -const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem') }; - const server = tls.createServer(options, function(s) { s.end('hello'); }).listen(0, function() { @@ -26,7 +28,6 @@ const server = tls.createServer(options, function(s) { }); }); - function putImmediate(client) { setImmediate(function() { if (client.ssl) { diff --git a/test/parallel/test-tty-stdin-end.js b/test/parallel/test-tty-stdin-end.js new file mode 100644 index 00000000000000..c78f58446d03e9 --- /dev/null +++ b/test/parallel/test-tty-stdin-end.js @@ -0,0 +1,7 @@ +'use strict'; +require('../common'); + +// This test ensures that Node.js doesn't crash on `process.stdin.emit("end")`. +// https://github.com/nodejs/node/issues/1068 + +process.stdin.emit('end'); diff --git a/test/parallel/test-regress-GH-io-1811.js b/test/parallel/test-zlib-kmaxlength-rangeerror.js similarity index 76% rename from test/parallel/test-regress-GH-io-1811.js rename to test/parallel/test-zlib-kmaxlength-rangeerror.js index a8966da10ba1f7..e8e47865f79604 100644 --- a/test/parallel/test-regress-GH-io-1811.js +++ b/test/parallel/test-zlib-kmaxlength-rangeerror.js @@ -1,6 +1,10 @@ 'use strict'; - require('../common'); + +// This test ensures that zlib throws a RangeError if the final buffer needs to +// be larger than kMaxLength and concatenation fails. +// https://github.com/nodejs/node/pull/1811 + const assert = require('assert'); // Change kMaxLength for zlib to trigger the error without having to allocate