summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-12-25 22:22:31 -0800
committerRich Trott <rtrott@gmail.com>2019-01-07 11:36:35 -0800
commita5c9491e730940a28001249fd62e547740725a69 (patch)
tree4ef987cf0acc0a884e77146ec0a6d55afcdf41ca /test
parentec5884a94f24351b2920ac3e54960999fdc05054 (diff)
downloadandroid-node-v8-a5c9491e730940a28001249fd62e547740725a69.tar.gz
android-node-v8-a5c9491e730940a28001249fd62e547740725a69.tar.bz2
android-node-v8-a5c9491e730940a28001249fd62e547740725a69.zip
test: fix test-tls-securepair-client
test-tls-securepair-client has been failing for over a year but no one noticed because pummel tests are almost never run. In preparation for running pummel tests once a day in CI, fix test-tls-securepair-client. PR-URL: https://github.com/nodejs/node/pull/25222 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/pummel/test-tls-securepair-client.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/pummel/test-tls-securepair-client.js b/test/pummel/test-tls-securepair-client.js
index 09006228c2..eec65af8a1 100644
--- a/test/pummel/test-tls-securepair-client.js
+++ b/test/pummel/test-tls-securepair-client.js
@@ -29,6 +29,9 @@ if (!common.opensslCli)
if (!common.hasCrypto)
common.skip('missing crypto');
+if (common.isWindows)
+ common.skip('test does not work on Windows'); // ...but it should!
+
const net = require('net');
const assert = require('assert');
const fixtures = require('../common/fixtures');
@@ -54,14 +57,14 @@ function test2() {
test('keys/agent4-key.pem', 'keys/agent4-cert.pem', check);
}
-function test(keyfn, certfn, check, next) {
- const key = fixtures.readSync(keyfn).toString();
- const cert = fixtures.readSync(certfn).toString();
+function test(keyPath, certPath, check, next) {
+ const key = fixtures.readSync(keyPath).toString();
+ const cert = fixtures.readSync(certPath).toString();
const server = spawn(common.opensslCli, ['s_server',
'-accept', common.PORT,
- '-cert', certfn,
- '-key', keyfn]);
+ '-cert', fixtures.path(certPath),
+ '-key', fixtures.path(keyPath)]);
server.stdout.pipe(process.stdout);
server.stderr.pipe(process.stdout);
@@ -72,7 +75,7 @@ function test(keyfn, certfn, check, next) {
server.stdout.setEncoding('utf8');
server.stdout.on('data', function(s) {
serverStdoutBuffer += s;
- console.error(state);
+ console.log(state);
switch (state) {
case 'WAIT-ACCEPT':
if (/ACCEPT/.test(serverStdoutBuffer)) {
@@ -132,6 +135,11 @@ function test(keyfn, certfn, check, next) {
s.on('connect', function() {
console.log('client connected');
+ setTimeout(function() {
+ pair.cleartext.write('hello\r\n', function() {
+ gotWriteCallback = true;
+ });
+ }, 500);
});
pair.on('secure', function() {
@@ -141,11 +149,6 @@ function test(keyfn, certfn, check, next) {
console.log('client pair.cleartext.getCipher(): %j',
pair.cleartext.getCipher());
if (check) check(pair);
- setTimeout(function() {
- pair.cleartext.write('hello\r\n', function() {
- gotWriteCallback = true;
- });
- }, 500);
});
pair.cleartext.on('data', function(d) {