greenlock-store-fs.js/test.js

34 lines
976 B
JavaScript
Raw Permalink Normal View History

2019-11-02 18:38:12 +00:00
"use strict";
2019-04-08 07:43:42 +00:00
2019-11-02 18:38:12 +00:00
var tester = require("greenlock-store-test");
2019-04-08 07:43:42 +00:00
2019-11-02 18:38:12 +00:00
var crypto = require("crypto");
var os = require("os");
var path = require("path");
var basedir = path.join(
os.tmpdir(),
"greenlock-store-fs-test-" + crypto.randomBytes(4).toString("hex")
);
var domain = "*.example.com";
var store = require("./").create({
configDir: basedir,
accountsDir: path.join(basedir, "accounts"),
privkeyPath: path.join(basedir, "live", domain, "privkey.pem"),
fullchainPath: path.join(basedir, "live", domain, "fullchain.pem"),
certPath: path.join(basedir, "live", domain, "cert.pem"),
chainPath: path.join(basedir, "live", domain, "chain.pem"),
bundlePath: path.join(basedir, "live", domain, "bundle.pem")
2019-04-08 07:43:42 +00:00
});
2019-11-02 18:38:12 +00:00
console.info("Test Dir:", basedir);
2019-04-08 07:43:42 +00:00
2019-11-02 18:38:12 +00:00
tester
.test(store)
.then(function() {
console.info("PASS");
})
.catch(function(err) {
console.error("FAIL");
console.error(err);
process.exit(20);
});