17 lines
745 B
JavaScript

"use strict";
const test = require("node:test");
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const source = fs.readFileSync(path.join(__dirname, "bootstrap.sh"), "utf8");
test("bootstrap creates the common Guanghu filesystem boundary", () => {
assert.match(source, /\/etc\/guanghu\/secrets/);
assert.match(source, /\/etc\/guanghu\/navigation-maps/);
assert.match(source, /\/var\/lib\/guanghu/);
});
test("bootstrap requires an explicit node id and map", () => {
assert.match(source, /NODE_ID=\$\{1:\?/);
assert.match(source, /MAP_FILE=\$\{2:\?/);
});
test("bootstrap never installs a shared token", () => assert.doesNotMatch(source, /zy_gtw_|Bearer\s+[A-Za-z0-9]/));