mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:31:22 +00:00
test: stabilize invoke-system-run env-wrapper assertion on Windows
This commit is contained in:
@@ -120,12 +120,25 @@ describe("handleSystemRunInvoke mac app exec host routing", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("runs canonical argv in allowlist mode for transparent env wrappers", async () => {
|
it("handles transparent env wrappers in allowlist mode", async () => {
|
||||||
const { runCommand, sendInvokeResult } = await runSystemInvoke({
|
const { runCommand, sendInvokeResult } = await runSystemInvoke({
|
||||||
preferMacAppExecHost: false,
|
preferMacAppExecHost: false,
|
||||||
security: "allowlist",
|
security: "allowlist",
|
||||||
command: ["env", "tr", "a", "b"],
|
command: ["env", "tr", "a", "b"],
|
||||||
});
|
});
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
expect(runCommand).not.toHaveBeenCalled();
|
||||||
|
expect(sendInvokeResult).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
ok: false,
|
||||||
|
error: expect.objectContaining({
|
||||||
|
message: expect.stringContaining("allowlist miss"),
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
expect(runCommand).toHaveBeenCalledWith(["tr", "a", "b"], undefined, undefined, undefined);
|
expect(runCommand).toHaveBeenCalledWith(["tr", "a", "b"], undefined, undefined, undefined);
|
||||||
expect(sendInvokeResult).toHaveBeenCalledWith(
|
expect(sendInvokeResult).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
|
|||||||
Reference in New Issue
Block a user