From 7e6834ba5eff5c0e61891ec1935e5e0ca8291c2f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 29 Oct 2026 12:32:23 -0300 Subject: tests on FreeBSD: Linux's /proc/1 fixtures, the builtins lists, daemon.py and fs.py without /proc - The refusing directory some tests name is Linux's /proc/1/root: that part skips elsewhere. The committed builtins-*.json are Linux builds' (Tty9p): their check skips, and a key the docs give a word this build leaves out is found in the other's list. - kitty: a shared memory object is sized before it is written (FreeBSD's write does not grow it); a FIFO in /dev/shm is Linux's case. - daemon.py asks ps and procstat where there is no /proc, and finds bash on PATH. fs.py runs printenv once a name, and skips two permission checks as root, who searches and writes anywhere. Co-Authored-By: Claude Opus 5.5 --- src/ninep/ctl.zig | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/ninep') diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 9cb96667..3176ebc8 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -4676,8 +4676,8 @@ test "pager answers its +Pager on the open that asked, whatever another client e try testing.expectEqualStrings("/tmp/+Pager", second_pane.file.?.path); try testing.expect(p.paneBySerial(paged) != null); _ = call(p, .{ .tag = 14, .op = .release, .node = pager, .handle = resolved, .opened = true }); - // One that may not be written is refused, permission denied. - try testing.expectEqual(E.PERM, wr(p, pager, "/proc/1\n").errno()); + // One that may not be written is refused, permission denied (Linux's /proc/1). + if (comptime @import("builtin").os.tag == .linux) try testing.expectEqual(E.PERM, wr(p, pager, "/proc/1\n").errno()); // One directory a write, absolute, and there. try testing.expectEqual(E.INVAL, wr(p, pager, "/a\n/b\n").errno()); // One directory an open: one refused is not followed by another, as a @@ -4786,8 +4786,11 @@ test "a command pane an exec open was answered is leased to it while it stays op test "a Save whose directory is missing because one above refuses says permission denied, not no such directory" { const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); - p.saveFailed(0, "/proc/1/root/x/f.txt", error.FileNotFound); - try testing.expect(th.logHas(p, "Save /proc/1/root/x/f.txt: permission denied")); + // The refusing directory is Linux's /proc/1/root. + if (comptime @import("builtin").os.tag == .linux) { + p.saveFailed(0, "/proc/1/root/x/f.txt", error.FileNotFound); + try testing.expect(th.logHas(p, "Save /proc/1/root/x/f.txt: permission denied")); + } p.saveFailed(0, "/tmp/pardes-surely-missing-dir/f.txt", error.FileNotFound); try testing.expect(th.logHas(p, "no such directory")); } @@ -5036,8 +5039,10 @@ test "DumpDir refuses a relative directory and one that may not be written, up f defer p.deinit(); const root_ctl = @backingInt(tree.TopFile.ctl); try testing.expectEqual(E.INVAL, wr(p, root_ctl, "DumpDir dumps\n").errno()); - try testing.expectEqual(E.INVAL, wr(p, root_ctl, "DumpDir /proc/1/root/dumps\n").errno()); try testing.expectEqual(Status.ok, wr(p, root_ctl, "DumpDir /tmp/pardes-dumps-test\n").reply.status); + // The refusing directory is Linux's /proc/1/root. + if (comptime @import("builtin").os.tag != .linux) return; + try testing.expectEqual(E.INVAL, wr(p, root_ctl, "DumpDir /proc/1/root/dumps\n").errno()); p.fs.late_failure_len = 0; p.dumpFailed("/proc/1/root/x/pardes.dump.zon", error.FileNotFound); try testing.expect(std.mem.endsWith(u8, p.fs.late_failure[0..p.fs.late_failure_len], ": permission denied")); -- cgit v1.3