test(windows): normalize risky-path assertions
This commit is contained in:
@@ -50,7 +50,7 @@ describe("resolveSandboxedMediaSource", () => {
|
||||
media,
|
||||
sandboxRoot: sandboxDir,
|
||||
});
|
||||
expect(result).toBe(expected);
|
||||
expect(result).toBe(path.resolve(expected));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -439,10 +439,14 @@ describe("security audit", () => {
|
||||
});
|
||||
|
||||
it("warns for risky safeBinTrustedDirs entries", async () => {
|
||||
const riskyGlobalTrustedDirs =
|
||||
process.platform === "win32"
|
||||
? [String.raw`C:\Users\ci-user\bin`, String.raw`C:\Users\ci-user\.local\bin`]
|
||||
: ["/usr/local/bin", "/tmp/openclaw-safe-bins"];
|
||||
const cfg: OpenClawConfig = {
|
||||
tools: {
|
||||
exec: {
|
||||
safeBinTrustedDirs: ["/usr/local/bin", "/tmp/openclaw-safe-bins"],
|
||||
safeBinTrustedDirs: riskyGlobalTrustedDirs,
|
||||
},
|
||||
},
|
||||
agents: {
|
||||
@@ -464,8 +468,8 @@ describe("security audit", () => {
|
||||
(f) => f.checkId === "tools.exec.safe_bin_trusted_dirs_risky",
|
||||
);
|
||||
expect(finding?.severity).toBe("warn");
|
||||
expect(finding?.detail).toContain("/usr/local/bin");
|
||||
expect(finding?.detail).toContain("/tmp/openclaw-safe-bins");
|
||||
expect(finding?.detail).toContain(riskyGlobalTrustedDirs[0]);
|
||||
expect(finding?.detail).toContain(riskyGlobalTrustedDirs[1]);
|
||||
expect(finding?.detail).toContain("agents.list.ops.tools.exec");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user