From eaa30e49476123a63f826a66436e680bee7b6d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 11 Jan 2018 17:32:05 +0100 Subject: [PATCH] test: simplify loadDHParam in TLS test PR-URL: https://github.com/nodejs/node/pull/18103 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca --- test/parallel/test-tls-client-getephemeralkeyinfo.js | 5 +---- test/parallel/test-tls-client-mindhsize.js | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-tls-client-getephemeralkeyinfo.js b/test/parallel/test-tls-client-getephemeralkeyinfo.js index a73f0fafd9dd6a..50848a420d57bc 100644 --- a/test/parallel/test-tls-client-getephemeralkeyinfo.js +++ b/test/parallel/test-tls-client-getephemeralkeyinfo.js @@ -6,7 +6,6 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const tls = require('tls'); -const fs = require('fs'); const key = fixtures.readKey('agent2-key.pem'); const cert = fixtures.readKey('agent2-cert.pem'); @@ -15,9 +14,7 @@ let ntests = 0; let nsuccess = 0; function loadDHParam(n) { - let path = fixtures.fixturesDir; - if (n !== 'error') path += '/keys'; - return fs.readFileSync(`${path}/dh${n}.pem`); + return fixtures.readKey(`dh${n}.pem`); } const cipherlist = { diff --git a/test/parallel/test-tls-client-mindhsize.js b/test/parallel/test-tls-client-mindhsize.js index 51ea1f08b71c90..aab719ad44e4e3 100644 --- a/test/parallel/test-tls-client-mindhsize.js +++ b/test/parallel/test-tls-client-mindhsize.js @@ -14,10 +14,7 @@ let nsuccess = 0; let nerror = 0; function loadDHParam(n) { - const params = [`dh${n}.pem`]; - if (n !== 'error') - params.unshift('keys'); - return fixtures.readSync(params); + return fixtures.readKey(`dh${n}.pem`); } function test(size, err, next) {