添加 docker runsh 命令
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { buildScript } = require("./restore-run");
|
||||
|
||||
const inspectPath = path.join(__dirname, "testcase-inspect.json");
|
||||
const expectedPath = path.join(__dirname, "testcase-run.sh");
|
||||
|
||||
const inspectData = JSON.parse(fs.readFileSync(inspectPath, "utf8"));
|
||||
const info = Array.isArray(inspectData) ? inspectData[0] : inspectData;
|
||||
const actual = buildScript(info);
|
||||
const expected = fs.readFileSync(expectedPath, "utf8").replace(/\r\n/g, "\n");
|
||||
|
||||
assert.strictEqual(actual, expected);
|
||||
assert.ok(actual.includes("name=freshrss"));
|
||||
assert.ok(actual.includes("img=freshrss/freshrss:latest"));
|
||||
assert.ok(actual.includes('-v "$(pwd)/data:/var/www/FreshRSS/data"'));
|
||||
assert.ok(actual.includes('-v "$(pwd)/extensions:/var/www/FreshRSS/extensions"'));
|
||||
assert.strictEqual((actual.match(/-p 8082:80\/tcp/g) || []).length, 1);
|
||||
|
||||
console.log("restore-run testcase passed");
|
||||
Reference in New Issue
Block a user