test(fixtures): allow the active test temporary directory

This commit is contained in:
2026-10-30 04:31:38 -03:00
parent 8a560b8e6e
commit 7bc57d860f
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ with (root / "platform-calls.jsonl").open("a") as log:
def fixture_path(value): def fixture_path(value):
path = pathlib.Path(value).resolve() path = pathlib.Path(value).resolve()
if not path.is_relative_to(root): active_test = pathlib.Path(os.environ["BATS_TEST_TMPDIR"]).resolve()
if not (path.is_relative_to(root) or path.is_relative_to(active_test)):
sys.exit(f"Fixture refused path outside the suite: {path}") sys.exit(f"Fixture refused path outside the suite: {path}")
return path return path
+1
View File
@@ -34,6 +34,7 @@ teardown() {
} }
@test "suppress_enrollment disables daemons" { @test "suppress_enrollment disables daemons" {
TEST_DIR="$BATS_TEST_TMPDIR/volume"
DRY_RUN=false DRY_RUN=false
suppress_enrollment "$TEST_DIR" 2>/dev/null || true suppress_enrollment "$TEST_DIR" 2>/dev/null || true
local ldp="$TEST_DIR/private/var/db/com.apple.xpc.launchd/disabled.plist" local ldp="$TEST_DIR/private/var/db/com.apple.xpc.launchd/disabled.plist"