Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommonFixturesFix - Fixed references to common.fixturesDir in test-tl… #16041

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test/parallel/test-tls-client-getephemeralkeyinfo.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
'use strict';
const common = require('../common');
const fixtures = require('../common.fixtures');
if (!common.hasCrypto)
common.skip('missing crypto');

const assert = require('assert');
const tls = require('tls');
const fs = require('fs');

const key = fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`);
const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`);
const fixturesKey = fixtures.readKey('agent2-key.pem');
const fixturesCert = fixtures.readKey('agent2-cert.pem');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there shouldn't be reason to change the variable names here.


let ntests = 0;
let nsuccess = 0;

function loadDHParam(n) {
let path = common.fixturesDir;
let path = fixtures.fixturesDir;
if (n !== 'error') path += '/keys';
return fs.readFileSync(`${path}/dh${n}.pem`);
}
Expand All @@ -31,8 +32,8 @@ function test(size, type, name, next) {
if (name) tls.DEFAULT_ECDH_CURVE = name;

const options = {
key: key,
cert: cert,
key: fixturesKey,
cert: fixturesCert,
Copy link
Member

@jasnell jasnell Oct 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the key and cert variable names are not changed above, this can become just ...

const options = { key, cert, ciphers: cipher };

ciphers: cipher
};

Expand Down Expand Up @@ -84,7 +85,7 @@ function testECDHE256() {
}

function testECDHE512() {
test(521, 'ECDH', 'secp521r1', null);
test(512, 'ECDH', 'secp512r1', null);
ntests++;
}

Expand Down