Skip to content

Commit ac7d3fa

Browse files
author
Shigeki Ohtsu
committed
test: add -no_rand_screen to s_client opts on Win
RAND_screen() causes stability issues in invoking openssl-cli s_client on win2008r2 in CI. Disable to use it by adding -no_rand_screen options to all tls tests that use common.opensslCli. Fixes: #2150 PR-URL: #2209 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Joao Reis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent f90f1e7 commit ac7d3fa

9 files changed

+55
-11
lines changed

test/parallel/test-https-foafssl.js

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ server.listen(common.PORT, function() {
5353
'-cert', join(common.fixturesDir, 'foafssl.crt'),
5454
'-key', join(common.fixturesDir, 'foafssl.key')];
5555

56+
// for the performance and stability issue in s_client on Windows
57+
if (process.platform === 'win32')
58+
args.push('-no_rand_screen');
59+
5660
var client = spawn(common.opensslCli, args);
5761

5862
client.stdout.on('data', function(data) {

test/parallel/test-tls-alert.js

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ var server = tls.Server({
3333
}, null).listen(common.PORT, function() {
3434
var args = ['s_client', '-quiet', '-tls1_1',
3535
'-connect', '127.0.0.1:' + common.PORT];
36+
37+
// for the performance and stability issue in s_client on Windows
38+
if (process.platform === 'win32')
39+
args.push('-no_rand_screen');
40+
3641
var client = spawn(common.opensslCli, args);
3742
var out = '';
3843
client.stderr.setEncoding('utf8');

test/parallel/test-tls-dhe.js

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ function test(keylen, expectedCipher, cb) {
4343
server.listen(common.PORT, '127.0.0.1', function() {
4444
var args = ['s_client', '-connect', '127.0.0.1:' + common.PORT,
4545
'-cipher', ciphers];
46+
47+
// for the performance and stability issue in s_client on Windows
48+
if (process.platform === 'win32')
49+
args.push('-no_rand_screen');
50+
4651
var client = spawn(common.opensslCli, args);
4752
var out = '';
4853
client.stdout.setEncoding('utf8');

test/parallel/test-tls-ecdh-disable.js

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ server.listen(common.PORT, '127.0.0.1', function() {
3333
var cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers +
3434
' -connect 127.0.0.1:' + common.PORT;
3535

36+
// for the performance and stability issue in s_client on Windows
37+
if (process.platform === 'win32')
38+
cmd += ' -no_rand_screen';
39+
3640
exec(cmd, function(err, stdout, stderr) {
3741
// Old versions of openssl will still exit with 0 so we
3842
// can't just check if err is not null.

test/parallel/test-tls-ecdh.js

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ server.listen(common.PORT, '127.0.0.1', function() {
3636
var cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers +
3737
' -connect 127.0.0.1:' + common.PORT;
3838

39+
// for the performance and stability issue in s_client on Windows
40+
if (process.platform === 'win32')
41+
cmd += ' -no_rand_screen';
42+
3943
exec(cmd, function(err, stdout, stderr) {
4044
if (err) throw err;
4145
response = stdout;

test/parallel/test-tls-no-sslv3.js

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ server.listen(common.PORT, '127.0.0.1', function() {
2929
'-no_tls1_1',
3030
'-no_tls1_2',
3131
'-connect', address];
32+
33+
// for the performance and stability issue in s_client on Windows
34+
if (process.platform === 'win32')
35+
args.push('-no_rand_screen');
36+
3237
var client = spawn(common.opensslCli, args, { stdio: 'inherit' });
3338
client.once('exit', common.mustCall(function(exitCode) {
3439
assert.equal(exitCode, 1);

test/parallel/test-tls-securepair-server.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,14 @@ var opensslExitCode = -1;
9393

9494
server.listen(common.PORT, function() {
9595
// To test use: openssl s_client -connect localhost:8000
96-
var client = spawn(common.opensslCli, ['s_client', '-connect', '127.0.0.1:' +
97-
common.PORT]);
96+
97+
var args = ['s_client', '-connect', '127.0.0.1:' + common.PORT];
98+
99+
// for the performance and stability issue in s_client on Windows
100+
if (process.platform === 'win32')
101+
args.push('-no_rand_screen');
102+
103+
var client = spawn(common.opensslCli, args);
98104

99105

100106
var out = '';

test/parallel/test-tls-session-cache.js

+16-9
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,23 @@ function doTest(testOptions, callback) {
7070
callback(null, session.data);
7171
}, 100);
7272
});
73+
74+
var args = [
75+
's_client',
76+
'-tls1',
77+
'-connect', 'localhost:' + common.PORT,
78+
'-servername', 'ohgod',
79+
'-key', join(common.fixturesDir, 'agent.key'),
80+
'-cert', join(common.fixturesDir, 'agent.crt'),
81+
'-reconnect'
82+
].concat(testOptions.tickets ? [] : '-no_ticket');
83+
84+
// for the performance and stability issue in s_client on Windows
85+
if (process.platform === 'win32')
86+
args.push('-no_rand_screen');
87+
7388
server.listen(common.PORT, function() {
74-
var client = spawn(common.opensslCli, [
75-
's_client',
76-
'-tls1',
77-
'-connect', 'localhost:' + common.PORT,
78-
'-servername', 'ohgod',
79-
'-key', join(common.fixturesDir, 'agent.key'),
80-
'-cert', join(common.fixturesDir, 'agent.crt'),
81-
'-reconnect'
82-
].concat(testOptions.tickets ? [] : '-no_ticket'), {
89+
var client = spawn(common.opensslCli, args, {
8390
stdio: [ 0, 1, 'pipe' ]
8491
});
8592
var err = '';

test/parallel/test-tls-set-ciphers.js

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ server.listen(common.PORT, '127.0.0.1', function() {
4040
var cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers +
4141
' -connect 127.0.0.1:' + common.PORT;
4242

43+
// for the performance and stability issue in s_client on Windows
44+
if (process.platform === 'win32')
45+
cmd += ' -no_rand_screen';
46+
4347
exec(cmd, function(err, stdout, stderr) {
4448
if (err) throw err;
4549
response = stdout;

0 commit comments

Comments
 (0)