summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 12:32:23 -0300
committerGabriel Schneider <[email protected]>2026-10-29 13:11:16 -0300
commit7e6834ba5eff5c0e61891ec1935e5e0ca8291c2f (patch)
treeb64162d23d96aea1cff55cdb1899c026d9522ec1 /src/ninep/ctl.zig
parent6b89fed454fd56a3af4b576646538b45d3315146 (diff)
downloadpardes-7e6834ba5eff5c0e61891ec1935e5e0ca8291c2f.tar.gz
pardes-7e6834ba5eff5c0e61891ec1935e5e0ca8291c2f.zip
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 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig15
1 files changed, 10 insertions, 5 deletions
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"));