From 7e831bfba15bd0a834ac2561c7e28f7281f9e8b9 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 2 Jan 2011 01:54:19 -0800 Subject: [PATCH] Disable TLS tests when node doesn't have OpenSSL. --- test/simple/test-tls-client-verify.js | 6 ++++++ test/simple/test-tls-junk-closes-server.js | 5 +++++ test/simple/test-tls-securepair-client.js | 10 ++++++++++ test/simple/test-tls-securepair-server.js | 6 ++++++ test/simple/test-tls-server-verify.js | 5 +++++ 5 files changed, 32 insertions(+) diff --git a/test/simple/test-tls-client-verify.js b/test/simple/test-tls-client-verify.js index 78eb186f6c..923153b441 100644 --- a/test/simple/test-tls-client-verify.js +++ b/test/simple/test-tls-client-verify.js @@ -1,3 +1,9 @@ +if (!process.versions.openssl) { + console.error("Skipping because node compiled without OpenSSL."); + process.exit(0); +} + + var testCases = [ { ca: ['ca1-cert'], key: 'agent2-key', diff --git a/test/simple/test-tls-junk-closes-server.js b/test/simple/test-tls-junk-closes-server.js index 57f216fdeb..f76a157381 100644 --- a/test/simple/test-tls-junk-closes-server.js +++ b/test/simple/test-tls-junk-closes-server.js @@ -1,3 +1,8 @@ +if (!process.versions.openssl) { + console.error("Skipping because node compiled without OpenSSL."); + process.exit(0); +} + var common = require('../common'); var tls = require('tls'); var fs = require('fs'); diff --git a/test/simple/test-tls-securepair-client.js b/test/simple/test-tls-securepair-client.js index 9bcb7e75d5..7dbcc92091 100644 --- a/test/simple/test-tls-securepair-client.js +++ b/test/simple/test-tls-securepair-client.js @@ -1,3 +1,13 @@ +// There is a bug with 'openssl s_server' which makes it not flush certain +// important events to stdout when done over a pipe. Therefore we skip this +// test for all openssl versions less than 1.0.0. +if (!process.versions.openssl || + parseInt(process.versions.openssl.charCodeAt(0)) < 1) { + console.error("Skipping due to old OpenSSL version."); + process.exit(0); +} + + var common = require('../common'); var join = require('path').join; var net = require('net'); diff --git a/test/simple/test-tls-securepair-server.js b/test/simple/test-tls-securepair-server.js index b172b11001..0131b8c517 100644 --- a/test/simple/test-tls-securepair-server.js +++ b/test/simple/test-tls-securepair-server.js @@ -1,3 +1,9 @@ +if (!process.versions.openssl) { + console.error("Skipping because node compiled without OpenSSL."); + process.exit(0); +} + + var common = require('../common'); var assert = require('assert'); diff --git a/test/simple/test-tls-server-verify.js b/test/simple/test-tls-server-verify.js index 9d3c094bda..914c50f476 100644 --- a/test/simple/test-tls-server-verify.js +++ b/test/simple/test-tls-server-verify.js @@ -1,3 +1,8 @@ +if (!process.versions.openssl) { + console.error("Skipping because node compiled without OpenSSL."); + process.exit(0); +} + // This is a rather complex test which sets up various TLS servers with node // and connects to them using the 'openssl s_client' command line utility // with various keys. Depending on the certificate authority and other