forked from mtusi2026/mtusi2026lab7
Prepare verified laboratory 7 implementation and evidence
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { chromium } from "playwright-core";
|
||||
import { mkdtemp } from "node:fs/promises";
|
||||
import { requireThat, root, local } from "../scripts/runtime";
|
||||
import { resolve } from "node:path";
|
||||
requireThat(
|
||||
root === "/mnt/data/home/bench-saves/mtuci-vp7-security-20261115",
|
||||
"BROWSER_LAUNCH_REMOTE_REQUIRED",
|
||||
);
|
||||
const profile = await mkdtemp(resolve(local, "u-"));
|
||||
requireThat(
|
||||
Buffer.byteLength(profile + "/SingletonSocket") < 90,
|
||||
"BROWSER_PROFILE_PATH_TOO_LONG",
|
||||
);
|
||||
const context = await chromium.launchPersistentContext(profile, {
|
||||
executablePath: "/usr/bin/chromium",
|
||||
headless: true,
|
||||
args: ["--no-sandbox", "--disable-gpu"],
|
||||
env: { ...process.env, TMPDIR: root },
|
||||
});
|
||||
try {
|
||||
const page = await context.newPage();
|
||||
await page.goto("about:blank");
|
||||
requireThat(page.url() === "about:blank", "BROWSER_BLANK_PAGE_FAILED");
|
||||
console.log("PASS_NATIVE_SHORT_PROFILE_BROWSER_LAUNCH");
|
||||
} finally {
|
||||
await context.close();
|
||||
}
|
||||
Reference in New Issue
Block a user