Skip to content

test(tcc): opt-in integration test for the real TCC read#14

Merged
AdamXweb merged 1 commit into
mainfrom
test/tcc-fda-verification
Jul 7, 2026
Merged

test(tcc): opt-in integration test for the real TCC read#14
AdamXweb merged 1 commit into
mainfrom
test/tcc-fda-verification

Conversation

@adamXbot

@adamXbot adamXbot commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Opt-in integration test for the real TCC read

The permission matrix's granted column reads the OS TCC databases via
TCCAuditor. The unit tests only approximate the schema with fixtures; this
adds an opt-in integration test that verifies the parser against the actual
on-disk TCC.db on a real machine.

Reading TCC.db requires the running process to hold Full Disk Access, so
the test is gated behind PC_TCC_INTEGRATION=1 (like the Ghidra integration
test). Without FDA it fails with a clear "grant Full Disk Access" message;
without the env var it simply skips, so normal swift test / CI is unaffected.

How to run

  1. Grant Full Disk Access to the terminal / app that will run the test
    (System Settings › Privacy & Security › Full Disk Access).
  2. PC_TCC_INTEGRATION=1 swift test --filter TCCAuditorIntegrationTests

It prints a summary of the grants it read (scope, service, decision, mapped
category, client) so you can eyeball the parse, then asserts the mapping
produced sane grants — including that at least one maps to a known
PrivacyCategory, which would catch service-catalog drift on a newer macOS.

🤖 Generated with Claude Code

…matrix)

Verifies TCCAuditor against the actual on-disk TCC.db (the permission matrix's
granted column) rather than fixtures. Gated behind PC_TCC_INTEGRATION=1 and
requires Full Disk Access; skips otherwise, so normal swift test / CI is
unaffected. Prints a summary of the grants read and asserts the mapping is sane.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AdamXweb AdamXweb merged commit 6cf7b19 into main Jul 7, 2026
1 check passed
@AdamXweb AdamXweb deleted the test/tcc-fda-verification branch July 7, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants