Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/config/owner-registry-acl.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, expect, test } from "bun:test";
import { chmodSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, symlinkSync, writeFileSync } from "node:fs";
import { chmodSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, symlinkSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, sep } from "node:path";
import { ownerRegistryDir, readOwnerRegistry, registerOwnerRegistryHome } from "../../src/config/owner-registry";
Expand All @@ -19,7 +19,11 @@ let home: string;
let calls: string[][];

beforeEach(() => {
root = mkdtempSync(join(tmpdir(), "ocx-owner-registry-acl-"));
// The no-follow writer canonicalizes the registry directory before naming its temp file, so
// the mocked icacls runner sees the real path. On macOS tmpdir() sits under /var, a symlink to
// /private/var: an uncanonical root made the prefix assertion throw inside the runner, the
// required entry hardening failed, and registration silently wrote nothing.
root = realpathSync(mkdtempSync(join(tmpdir(), "ocx-owner-registry-acl-")));
home = join(root, "home");
mkdirSync(home);
writeFileSync(join(home, "runtime-port.json"), "{}\n");
Expand Down
Loading