mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Significantly speed up the generateSSLtest by reducing the bits in the key from 2048 to 512.
28 lines
1013 B
JavaScript
28 lines
1013 B
JavaScript
var assert = require("assert");
|
|
var fs = require("fs-extra");
|
|
|
|
var fileOps = require("lib/fileOps");
|
|
var generateSSLcert = require("lib/generateSSLcert")
|
|
|
|
describe("generateSSLcert.js(options)", ()=>{
|
|
it("Creates a folder with a .crt and .key file in it", async function() {
|
|
/* istanbul ignore if */ if (process.env.FAST_TEST) this.skip();
|
|
let certPath = "lib/certTestPlsDelete/cert.crt";
|
|
let privKeyPath = "lib/certTestPlsDelete/cert.key";
|
|
assert(!await fs.exists(certPath)); // if it already exsits, the test might pass because of leftover data (which is bad)
|
|
|
|
await generateSSLcert({
|
|
bits: 512, // This is too small for real world usage, but faster to test
|
|
sslCertPath: certPath,
|
|
sslPrivKeyPath: privKeyPath,
|
|
doLogging: false,
|
|
});
|
|
|
|
assert(await fs.exists(certPath)); // private key
|
|
assert(await fs.exists(privKeyPath)); // certificate file
|
|
|
|
// remove certificates and data from the test
|
|
fileOps.deleteFolderRecursiveSync("lib/certTestPlsDelete");
|
|
}).timeout(10000);
|
|
});
|