summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorUjjwal Sharma <usharma1998@gmail.com>2018-03-14 03:13:29 +0530
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2018-12-03 18:09:58 +0000
commit8fa5bd37611b2952e6b641932700cd0850bd4b40 (patch)
tree390ccffc10d379bb41a14ecbf3929f9d31127bc3 /test
parentf5683a9a6dcecd367b95947a22b50acef19f323d (diff)
downloadnode-new-8fa5bd37611b2952e6b641932700cd0850bd4b40.tar.gz
test: rename regression tests file names
Rename the tests appropriately alongside mentioning the subsystem. Also, make a few basic changes to make sure the tests conform to the standard test structure. - Rename test-regress-GH-io-1068 to test-tty-stdin-end - Rename test-regress-GH-io-1811 to test-zlib-kmaxlength-rangeerror - Rename test-regress-GH-node-9326 to test-kill-segfault-freebsd - Rename test-timers-regress-GH-9765 to test-timers-setimmediate-infinite-loop - Rename test-tls-pfx-gh-5100-regr to test-tls-pfx-authorizationerror - Rename test-tls-regr-gh-5108 to test-tls-tlswrap-segfault PR-URL: https://github.com/nodejs/node/pull/19332 Fixes: https://github.com/nodejs/node/issues/19105 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-kill-segfault-freebsd.js (renamed from test/parallel/test-regress-GH-node-9326.js)5
-rw-r--r--test/parallel/test-regress-GH-io-1068.js3
-rw-r--r--test/parallel/test-timers-setimmediate-infinite-loop.js (renamed from test/parallel/test-timers-regress-GH-9765.js)0
-rw-r--r--test/parallel/test-tls-pfx-authorizationerror.js42
-rw-r--r--test/parallel/test-tls-pfx-gh-5100-regr.js32
-rw-r--r--test/parallel/test-tls-tlswrap-segfault.js (renamed from test/parallel/test-tls-regr-gh-5108.js)9
-rw-r--r--test/parallel/test-tty-stdin-end.js7
-rw-r--r--test/parallel/test-zlib-kmaxlength-rangeerror.js (renamed from test/parallel/test-regress-GH-io-1811.js)6
8 files changed, 64 insertions, 40 deletions
diff --git a/test/parallel/test-regress-GH-node-9326.js b/test/parallel/test-kill-segfault-freebsd.js
index 78565e3f59..8532f11c86 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 a92bb3e752..0000000000
--- 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
index 49adc390fa..49adc390fa 100644
--- a/test/parallel/test-timers-regress-GH-9765.js
+++ b/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 0000000000..64b6e1485d
--- /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 199d4bdf22..0000000000
--- 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
index 402a6014d1..eaa51ff51b 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 0000000000..c78f58446d
--- /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
index a8966da10b..e8e47865f7 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