mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 06:14:34 +00:00
fix: handle Windows and UNC bind mount parsing
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { SandboxContext } from "./types.js";
|
||||
import {
|
||||
buildSandboxFsMounts,
|
||||
parseSandboxBindMount,
|
||||
resolveSandboxFsPathWithMounts,
|
||||
} from "./fs-paths.js";
|
||||
import { createSandboxTestContext } from "./test-fixtures.js";
|
||||
import type { SandboxContext } from "./types.js";
|
||||
|
||||
function createSandbox(overrides?: Partial<SandboxContext>): SandboxContext {
|
||||
return createSandboxTestContext({ overrides });
|
||||
@@ -38,6 +38,14 @@ describe("parseSandboxBindMount", () => {
|
||||
writable: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("parses UNC-style host paths", () => {
|
||||
expect(parseSandboxBindMount("//server/share:/workspace:ro")).toEqual({
|
||||
hostRoot: path.resolve("//server/share"),
|
||||
containerRoot: "/workspace",
|
||||
writable: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveSandboxFsPathWithMounts", () => {
|
||||
|
||||
Reference in New Issue
Block a user