From 7bc57d860f8dc9d45b9350038e06700ff9a8bc48 Mon Sep 17 00:00:00 2001 From: ruihan Date: Fri, 30 Oct 2026 04:31:12 -0300 Subject: [PATCH] test(fixtures): allow the active test temporary directory --- tests/helpers/platform.py | 3 ++- tests/test_suppress.bats | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/helpers/platform.py b/tests/helpers/platform.py index 77431b4..24de34f 100644 --- a/tests/helpers/platform.py +++ b/tests/helpers/platform.py @@ -16,7 +16,8 @@ with (root / "platform-calls.jsonl").open("a") as log: def fixture_path(value): 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}") return path diff --git a/tests/test_suppress.bats b/tests/test_suppress.bats index fabc512..9ccbbfe 100644 --- a/tests/test_suppress.bats +++ b/tests/test_suppress.bats @@ -34,6 +34,7 @@ teardown() { } @test "suppress_enrollment disables daemons" { + TEST_DIR="$BATS_TEST_TMPDIR/volume" DRY_RUN=false suppress_enrollment "$TEST_DIR" 2>/dev/null || true local ldp="$TEST_DIR/private/var/db/com.apple.xpc.launchd/disabled.plist"