Skip to content

Commit 7df6d9d

Browse files
ryzokukenMylesBorins
authored andcommitted
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: #19332 Fixes: #19105 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Shingo Inoue <[email protected]>
1 parent 3bf69cd commit 7df6d9d

8 files changed

+64
-40
lines changed

test/parallel/test-regress-GH-node-9326.js test/parallel/test-kill-segfault-freebsd.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
'use strict';
22
require('../common');
3+
4+
// This test ensures Node.js doesn't crash on hitting Ctrl+C in order to
5+
// terminate the currently running process (especially on FreeBSD).
6+
// https://github.com/nodejs/node-v0.x-archive/issues/9326
7+
38
const assert = require('assert');
49
const child_process = require('child_process');
510

test/parallel/test-regress-GH-io-1068.js

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
'use strict';
2+
const common = require('../common');
3+
if (!common.hasCrypto)
4+
common.skip('node compiled without crypto.');
5+
const fixtures = require('../common/fixtures');
6+
7+
// This test ensures that TLS does not fail to read a self-signed certificate
8+
// and thus throw an `authorizationError`.
9+
// https://github.com/nodejs/node/issues/5100
10+
11+
const assert = require('assert');
12+
const tls = require('tls');
13+
14+
const pfx = fixtures.readKey('agent1-pfx.pem');
15+
16+
const server = tls
17+
.createServer(
18+
{
19+
pfx: pfx,
20+
passphrase: 'sample',
21+
requestCert: true,
22+
rejectUnauthorized: false
23+
},
24+
common.mustCall(function(c) {
25+
assert.strictEqual(c.authorizationError, null);
26+
c.end();
27+
})
28+
)
29+
.listen(0, function() {
30+
const client = tls.connect(
31+
{
32+
port: this.address().port,
33+
pfx: pfx,
34+
passphrase: 'sample',
35+
rejectUnauthorized: false
36+
},
37+
function() {
38+
client.end();
39+
server.close();
40+
}
41+
);
42+
});

test/parallel/test-tls-pfx-gh-5100-regr.js

-32
This file was deleted.

test/parallel/test-tls-regr-gh-5108.js test/parallel/test-tls-tlswrap-segfault.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
'use strict';
22
const common = require('../common');
3-
43
if (!common.hasCrypto)
54
common.skip('missing crypto');
5+
const fixtures = require('../common/fixtures');
6+
7+
// This test ensures that Node.js doesn't incur a segfault while accessing
8+
// TLSWrap fields after the parent handle was destroyed.
9+
// https://github.com/nodejs/node/issues/5108
610

711
const assert = require('assert');
812
const tls = require('tls');
9-
const fixtures = require('../common/fixtures');
1013

1114
const options = {
1215
key: fixtures.readKey('agent1-key.pem'),
1316
cert: fixtures.readKey('agent1-cert.pem')
1417
};
1518

16-
1719
const server = tls.createServer(options, function(s) {
1820
s.end('hello');
1921
}).listen(0, function() {
@@ -26,7 +28,6 @@ const server = tls.createServer(options, function(s) {
2628
});
2729
});
2830

29-
3031
function putImmediate(client) {
3132
setImmediate(function() {
3233
if (client.ssl) {

test/parallel/test-tty-stdin-end.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
require('../common');
3+
4+
// This test ensures that Node.js doesn't crash on `process.stdin.emit("end")`.
5+
// https://github.com/nodejs/node/issues/1068
6+
7+
process.stdin.emit('end');

test/parallel/test-regress-GH-io-1811.js test/parallel/test-zlib-kmaxlength-rangeerror.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
2-
32
require('../common');
3+
4+
// This test ensures that zlib throws a RangeError if the final buffer needs to
5+
// be larger than kMaxLength and concatenation fails.
6+
// https://github.com/nodejs/node/pull/1811
7+
48
const assert = require('assert');
59

610
// Change kMaxLength for zlib to trigger the error without having to allocate

0 commit comments

Comments
 (0)