From 22fb8b6147f7fb72407af80c36d5e99e4664fea2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 07:27:13 -0300 Subject: Mount dials its peer at once and fails if none answers; a peer out of reach is said as `dial failed: ` Mount took any well-formed dial and nothing was found out until the first look through it, which then said `look: look: dial`. Mount now probes the peer (version, attach, its root) with the turn out, and fails its write, mounting nothing, when none answers; the dial errors read as words, `no answer`, `timed out`, `hung up`, and a look through a peer gone since names its path: `look: /n/peer/f: dial failed: no answer`. Co-Authored-By: Claude Opus 5.5 --- test/fs_namespace.zig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/fs_namespace.zig') diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig index 2f78ca1a..bd620c2d 100644 --- a/test/fs_namespace.zig +++ b/test/fs_namespace.zig @@ -6,9 +6,15 @@ test "runtime Mount and Unmount copy command arguments and change Look resolutio const gpa = std.testing.allocator; const p = try pardes.Pardes.init(gpa, .{ .tty_only = true }); defer p.deinit(); - var command = "Mount peer /tmp/a socket.sock".*; - try std.testing.expect(p.executeBuiltinLine(0, &command)); - @memset(&command, 'x'); + // No peer answers at the dial: Mount mounts nothing (it dials first). + try std.testing.expect(p.executeBuiltinLine(0, "Mount peer /tmp/a socket.sock")); + try std.testing.expectEqual(@as(usize, 0), p.fs.mounts.items.len); + // Mounted (as one that answered is), its arguments are copies. + var name = "peer".*; + var dial = "/tmp/a socket.sock".*; + try p.fs.mount(gpa, &name, &dial); + @memset(&name, 'x'); + @memset(&dial, 'x'); try std.testing.expectEqual(@as(usize, 1), p.fs.mounts.items.len); try std.testing.expectEqualStrings("peer", p.fs.mounts.items[0].name); try std.testing.expectEqualStrings("/tmp/a socket.sock", p.fs.mounts.items[0].dial); -- cgit v1.3