





















@@ -180,11 +180,11 @@ describe("validateBindMounts", () => {
180180});
181181182182it("compares Windows allowed roots case-insensitively", () => {
183-expect(() =>
183+expect(
184184validateBindMounts(["d:/DATA/OpenClaw/src:/src:ro"], {
185185allowedSourceRoots: ["D:/data/openclaw"],
186186}),
187-).not.toThrow();
187+).toBeUndefined();
188188189189expect(() =>
190190validateBindMounts(["D:/other/project:/src:ro"], {
@@ -280,22 +280,22 @@ describe("validateBindMounts", () => {
280280281281it("allows bind sources in allowed roots when allowlist is configured", () => {
282282const projectRoot = mkdtempSync(join(tmpdir(), "openclaw-sbx-allowed-"));
283-expect(() =>
283+expect(
284284validateBindMounts([`${join(projectRoot, "cache")}:/data:ro`], {
285285allowedSourceRoots: [projectRoot],
286286}),
287-).not.toThrow();
287+).toBeUndefined();
288288});
289289290290it("allows bind sources outside allowed roots with explicit dangerous override", () => {
291291const allowedRoot = mkdtempSync(join(tmpdir(), "openclaw-sbx-allowed-root-"));
292292const externalRoot = mkdtempSync(join(tmpdir(), "openclaw-sbx-external-"));
293-expect(() =>
293+expect(
294294validateBindMounts([`${externalRoot}:/data:ro`], {
295295allowedSourceRoots: [allowedRoot],
296296allowSourcesOutsideAllowedRoots: true,
297297}),
298-).not.toThrow();
298+).toBeUndefined();
299299});
300300301301it("blocks reserved container target paths by default", () => {
@@ -307,11 +307,11 @@ describe("validateBindMounts", () => {
307307308308it("allows reserved container target paths with explicit dangerous override", () => {
309309const projectRoot = mkdtempSync(join(tmpdir(), "openclaw-sbx-reserved-"));
310-expect(() =>
310+expect(
311311validateBindMounts([`${projectRoot}:/workspace:rw`], {
312312allowReservedContainerTargets: true,
313313}),
314-).not.toThrow();
314+).toBeUndefined();
315315});
316316});
317317@@ -354,11 +354,11 @@ describe("validateNetworkMode", () => {
354354});
355355356356it("allows container namespace joins with explicit dangerous override", () => {
357-expect(() =>
357+expect(
358358validateNetworkMode("container:abc123", {
359359allowContainerNamespaceJoin: true,
360360}),
361-).not.toThrow();
361+).toBeUndefined();
362362});
363363});
364364@@ -397,13 +397,13 @@ describe("profile hardening", () => {
397397describe("validateSandboxSecurity", () => {
398398it("passes with safe config", () => {
399399const projectRoot = mkdtempSync(join(tmpdir(), "openclaw-sbx-safe-config-"));
400-expect(() =>
400+expect(
401401validateSandboxSecurity({
402402binds: [`${projectRoot}:/src:rw`],
403403network: "none",
404404seccompProfile: "/tmp/seccomp.json",
405405apparmorProfile: "openclaw-sandbox",
406406}),
407-).not.toThrow();
407+).toBeUndefined();
408408});
409409});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。