test: tighten openshell boundary assertions · openclaw/openclaw@f5e053e
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -272,8 +272,10 @@ describe("openshell fs bridges", () => {
|
272 | 272 | data: "owned", |
273 | 273 | mkdir: true, |
274 | 274 | }), |
275 | | -).rejects.toThrow(); |
276 | | -await expect(fs.stat(path.join(outsideDir, "escape.txt"))).rejects.toThrow(); |
| 275 | +).rejects.toThrow("Sandbox path escapes allowed mounts"); |
| 276 | +await expect(fs.stat(path.join(outsideDir, "escape.txt"))).rejects.toMatchObject({ |
| 277 | +code: "ENOENT", |
| 278 | +}); |
277 | 279 | await expect(fs.readdir(outsideDir)).resolves.toEqual([]); |
278 | 280 | expect(backend.syncLocalPathToRemote).not.toHaveBeenCalled(); |
279 | 281 | }); |
@@ -302,7 +304,7 @@ describe("openshell fs bridges", () => {
|
302 | 304 | data: "owned", |
303 | 305 | mkdir: true, |
304 | 306 | }), |
305 | | -).rejects.toThrow(); |
| 307 | +).rejects.toThrow("Sandbox boundary checks failed"); |
306 | 308 | await expect(fs.readlink(path.join(workspaceDir, "link.txt"))).resolves.toBe("existing.txt"); |
307 | 309 | await expect(fs.readFile(linkedTarget, "utf8")).resolves.toBe("keep"); |
308 | 310 | expect(backend.syncLocalPathToRemote).not.toHaveBeenCalled(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。