mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 20:35:39 -06:00
test: tighten cron sandbox config assertions
This commit is contained in:
@@ -78,10 +78,9 @@ describe("runCronIsolatedAgentTurn sandbox config preserved", () => {
|
||||
tools: undefined,
|
||||
});
|
||||
expectDefaultSandboxPreserved(runCfg);
|
||||
expect(resolveSandboxConfigForAgent(runCfg, "worker")).toMatchObject({
|
||||
mode: "all",
|
||||
workspaceAccess: "rw",
|
||||
});
|
||||
const resolvedSandbox = resolveSandboxConfigForAgent(runCfg, "worker");
|
||||
expect(resolvedSandbox.mode).toBe("all");
|
||||
expect(resolvedSandbox.workspaceAccess).toBe("rw");
|
||||
});
|
||||
|
||||
it("keeps global sandbox defaults when agent override is partial", () => {
|
||||
@@ -103,20 +102,14 @@ describe("runCronIsolatedAgentTurn sandbox config preserved", () => {
|
||||
expectDefaultSandboxPreserved(runCfg);
|
||||
expect(resolvedSandbox.mode).toBe("all");
|
||||
expect(resolvedSandbox.workspaceAccess).toBe("rw");
|
||||
expect(resolvedSandbox.docker).toMatchObject({
|
||||
image: "ghcr.io/openclaw/sandbox:custom",
|
||||
network: "none",
|
||||
dangerouslyAllowContainerNamespaceJoin: true,
|
||||
dangerouslyAllowExternalBindSources: true,
|
||||
});
|
||||
expect(resolvedSandbox.browser).toMatchObject({
|
||||
enabled: true,
|
||||
image: "ghcr.io/openclaw/browser:custom",
|
||||
autoStart: false,
|
||||
});
|
||||
expect(resolvedSandbox.prune).toMatchObject({
|
||||
idleHours: 1,
|
||||
maxAgeDays: 7,
|
||||
});
|
||||
expect(resolvedSandbox.docker.image).toBe("ghcr.io/openclaw/sandbox:custom");
|
||||
expect(resolvedSandbox.docker.network).toBe("none");
|
||||
expect(resolvedSandbox.docker.dangerouslyAllowContainerNamespaceJoin).toBe(true);
|
||||
expect(resolvedSandbox.docker.dangerouslyAllowExternalBindSources).toBe(true);
|
||||
expect(resolvedSandbox.browser.enabled).toBe(true);
|
||||
expect(resolvedSandbox.browser.image).toBe("ghcr.io/openclaw/browser:custom");
|
||||
expect(resolvedSandbox.browser.autoStart).toBe(false);
|
||||
expect(resolvedSandbox.prune.idleHours).toBe(1);
|
||||
expect(resolvedSandbox.prune.maxAgeDays).toBe(7);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user