summaryrefslogtreecommitdiff
path: root/test/process
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:13:41 -0300
committerGabriel Schneider <[email protected]>2026-11-05 00:58:19 -0300
commit1e1212c86a13d3087a5db61e9f2a28cfcba4cc45 (patch)
treeff355c2d86482e1d21280fca2fc0fade773aa6c8 /test/process
parent6a665eb3d9b6542bc1765f57f19cd2fc8ce04e82 (diff)
downloadpardes-1e1212c86a13d3087a5db61e9f2a28cfcba4cc45.tar.gz
pardes-1e1212c86a13d3087a5db61e9f2a28cfcba4cc45.zip
9p_io, build: 9P over QUIC is gone: src/9p_quic.zig, the Listener's poll path on the editor's thread (its accept, fill, flush and watcher thread), the Client's quic! dials, -Dquic with its OpenSSL linking, the quic-test step that ran no test, Namespace.quic_address and /listeners' quic row, the QUIC process case, the perf baselines' quic key and every mention in the docs; main.zig still parses --9p-quic until the processes change takes it out, so 9p_io.quic_enabled stays, false, until then
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/process')
-rw-r--r--test/process/flags.zig4
-rw-r--r--test/process/mounts.zig102
2 files changed, 1 insertions, 105 deletions
diff --git a/test/process/flags.zig b/test/process/flags.zig
index e8f30504..7a1118f0 100644
--- a/test/process/flags.zig
+++ b/test/process/flags.zig
@@ -221,9 +221,7 @@ fn forwarding(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
.{ "shells", &.{ "-n", "3" }, null },
.{ "toggle", &.{ "--tty", "--tty-toggle=q" }, null },
.{ "toggle-arg", &.{ "--tty", "--tty-toggle", "q" }, null },
- .{ "quic", &.{ "--tty", "--9p-quic=quic!127.0.0.1!0" }, null },
}) |row| {
- if (std.mem.eql(u8, row[0], "quic") and !try process.quicIncluded(a, exe)) continue;
var argv: [8][:0]const u8 = undefined;
argv[0] = exe;
for (row[1], 1..) |arg, i| argv[i] = arg;
@@ -251,7 +249,7 @@ fn forwarding(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
// boot puts under it; --shells=3 is three shells, no scratch.
try check(rows == @as(usize, if (std.mem.eql(u8, row[0], "shells")) 3 else 2), "{s}: {s}", .{ row[0], index });
}
- if (std.mem.eql(u8, row[0], "tcp") or std.mem.eql(u8, row[0], "quic"))
+ if (std.mem.eql(u8, row[0], "tcp"))
try check(has(try local.read("/listeners"), try std.fmt.allocPrint(a, "{s}!127.0.0.1!", .{row[0]})), "{s}: no listener", .{row[0]});
try std.testing.expectEqualStrings(before, try c.read(a, "/index"));
try std.testing.expectEqualStrings("initial\n", try c.read(a, "/pane/1/body"));
diff --git a/test/process/mounts.zig b/test/process/mounts.zig
index 10dc7b5a..8a7fc6fe 100644
--- a/test/process/mounts.zig
+++ b/test/process/mounts.zig
@@ -9,7 +9,6 @@ const check = process.check;
pub const cases = .{
.{ "mounts: --mount at startup reads a peer's panes and its disk, a Save through it lands there, and a path not there is a miss in the log", startup },
- .{ "mounts: a session listening on TCP and QUIC too (-Dquic=true) is mounted over QUIC, saved and got through, its screen read, and unmounted, v4 and v6, detached and in a pty", quic },
.{ "mounts: Mount and Unmount at run time, refused in words when mounted already or in use; a session's /n lists its mounts; a file through a mount opens at startup", runtime },
};
@@ -109,104 +108,3 @@ fn runtime(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
defer d.deinit();
try d.files.expect("/pane/1/body", "runtime mounted Save\n");
}
-
-/// The port of /listeners' `<net>!<host>!<port>` line.
-fn port(listeners: []const u8, net: []const u8) !u16 {
- var rows = std.mem.tokenizeScalar(u8, listeners, '\n');
- while (rows.next()) |row| {
- var parts = std.mem.splitScalar(u8, row, '!');
- if (!std.mem.eql(u8, parts.first(), net)) continue;
- _ = parts.next() orelse return error.BadListener;
- const p = try std.fmt.parseInt(u16, parts.next() orelse return error.BadListener, 10);
- try check(parts.next() == null and p > 0, "listener {s}", .{row});
- return p;
- }
- return error.NoListener;
-}
-
-fn quic(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
- if (!try process.quicIncluded(gpa, exe)) {
- std.debug.print("SKIP a build without QUIC (-Dquic=true)\n", .{});
- return;
- }
- for ([_]bool{ false, true }) |tty| for ([_][:0]const u8{ "127.0.0.1", "::1" }) |host| {
- var arena = std.heap.ArenaAllocator.init(gpa);
- defer arena.deinit();
- const a = arena.allocator();
- const args = [_][:0]const u8{
- try std.fmt.allocPrintSentinel(a, "--9p-tcp=tcp!{s}!0", .{host}, 0),
- try std.fmt.allocPrintSentinel(a, "--9p-quic=quic!{s}!0", .{host}, 0),
- };
- var d = try Detached.start(gpa, exe, if (tty) "quic-root" else "server", .{ .args = if (tty) &.{} else &args });
- defer d.deinit();
- var term: ?process.Child = null;
- defer if (term) |*t| t.deinit();
- if (tty) term = try d.startTty(exe, "server", &args);
- const address = d.abs("pardes-9p-server.sock");
- const unix = try Conn.dial(gpa, address);
- defer unix.deinit(gpa);
- const listeners = try unix.read(a, "/listeners");
- const tcp_port = try port(listeners, "tcp");
- const quic_port = try port(listeners, "quic");
- try std.testing.expectEqual(@as(usize, 3), std.mem.count(u8, listeners, "\n"));
- for ([_][]const u8{
- try std.fmt.allocPrint(a, "unix!{s}\n", .{address}),
- try std.fmt.allocPrint(a, "tcp!{s}!{d}\n", .{ host, tcp_port }),
- try std.fmt.allocPrint(a, "quic!{s}!{d}\n", .{ host, quic_port }),
- }) |row| try check(has(listeners, row), "no {s} in {s}", .{ row, listeners });
- const tcp = try Conn.dialTcp(gpa, host, tcp_port);
- defer tcp.deinit(gpa);
- const unix_body = try unix.hold("/pane/1/body", 0);
- defer unix.clunk(unix_body);
- const tcp_body = try tcp.hold("/pane/1/body", 0);
- defer tcp.clunk(tcp_body);
- var client = try Detached.start(gpa, exe, "client", .{ .root = d.root() });
- defer client.deinit();
- const remote = try Conn.dial(gpa, client.socket());
- defer remote.deinit(gpa);
- const control = try remote.newPane();
- try remote.exec(control, try std.fmt.allocPrint(a, "Mount peer quic!{s}!{d}\n", .{ host, quic_port }));
- const opened = try remote.look(a, "/n/peer/pane/1/body", control);
- const body = try std.fmt.allocPrint(a, "/pane/{d}/body", .{opened});
- try std.testing.expectEqualStrings("initial\n", try remote.read(a, body));
- var payload: std.ArrayList(u8) = .empty;
- try payload.appendSlice(a, "saved café λ\n");
- try payload.appendNTimes(a, 'x', 3 * 8192 + 27);
- try payload.append(a, '\n');
- try remote.replace(body, payload.items);
- try remote.exec(opened, "Save\n");
- try std.testing.expectEqualStrings(payload.items[0..@min(payload.items.len, unix.cl.maxRead())], try unix.readFid(unix_body, 0, 65536));
- try check(std.mem.eql(u8, try tcp.read(a, "/pane/1/body"), payload.items), "TCP reads another body", .{});
- try tcp.replace("/pane/1/body", "TCP to QUIC Get\n");
- try remote.write(try std.fmt.allocPrint(a, "/pane/{d}/ctl", .{opened}), "get\n");
- try std.testing.expectEqualStrings("TCP to QUIC Get\n", try remote.read(a, body));
- try std.testing.expectEqualStrings("TCP to QUIC Get\n", try unix.readFid(unix_body, 0, 65536));
- try std.testing.expectEqualStrings("TCP to QUIC Get\n", try tcp.readFid(tcp_body, 0, 65536));
- // The peer's own screen, whole, over QUIC: its pane's tag, not its
- // text, whose place after the body shrank depends on a frame drawn.
- const screen_pane = try remote.look(a, "/n/peer/screen", control);
- const json = try std.json.parseFromSliceLeaky(std.json.Value, a, try remote.pane(a, screen_pane, "body"), .{});
- const cells = json.object.get("cells").?.array.items;
- try std.testing.expectEqual(@as(usize, @intCast(json.object.get("cols").?.integer * json.object.get("rows").?.integer)), cells.len);
- var text: std.ArrayList(u8) = .empty;
- for (cells) |cell| try text.appendSlice(a, cell.array.items[0].string);
- try check(has(text.items, "server.txt Save"), "the peer's screen has no tag", .{});
- var large: std.ArrayList(u8) = .empty;
- for (0..20000) |_| try large.appendSlice(a, "normal λ line\n");
- try d.put("large.txt", large.items);
- const large_pane = try remote.look(a, try std.fmt.allocPrint(a, "/n/peer/os{s}", .{d.abs("large.txt")}), control);
- try check(std.mem.eql(u8, try remote.pane(a, large_pane, "body"), large.items), "the large file is not whole", .{});
- try remote.replace(try std.fmt.allocPrint(a, "/pane/{d}/body", .{large_pane}), "QUIC file saved\n");
- try remote.exec(large_pane, "Save\n");
- try std.testing.expectEqualStrings("QUIC file saved\n", try d.get(a, "large.txt"));
- for ([_]u32{ opened, screen_pane, large_pane }) |n| try remote.exec(n, "Del\n");
- try remote.exec(control, "Unmount peer\n");
- const roots = try remote.look(a, "/n", control);
- try std.testing.expectEqualStrings("/n/os/\n/n/self/\n", try remote.pane(a, roots, "body"));
- try std.testing.expectEqualStrings("TCP to QUIC Get\n", try unix.readFid(unix_body, 0, 65536));
- try std.testing.expectEqualStrings("TCP to QUIC Get\n", try tcp.readFid(tcp_body, 0, 65536));
- // Not checked: a session Looking at its OWN tree through a QUIC
- // mount: QUIC is answered on the editor's thread, so that Look waits
- // on the loop it runs in (features.txt, "Left as they are").
- };
-}