Skip to content

Commit

Permalink
test: rename regression tests file names
Browse files Browse the repository at this point in the history
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: #19332
Fixes: #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>
  • Loading branch information
ryzokuken authored and BethGriggs committed Dec 3, 2018
1 parent f5683a9 commit 8fa5bd3
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
3 changes: 0 additions & 3 deletions test/parallel/test-regress-GH-io-1068.js

This file was deleted.

42 changes: 42 additions & 0 deletions test/parallel/test-tls-pfx-authorizationerror.js
Original file line number Diff line number Diff line change
@@ -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();
}
);
});
32 changes: 0 additions & 32 deletions test/parallel/test-tls-pfx-gh-5100-regr.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -26,7 +28,6 @@ const server = tls.createServer(options, function(s) {
});
});


function putImmediate(client) {
setImmediate(function() {
if (client.ssl) {
Expand Down
7 changes: 7 additions & 0 deletions test/parallel/test-tty-stdin-end.js
Original file line number Diff line number Diff line change
@@ -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');
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 8fa5bd3

Please sign in to comment.