Skip to content

Add TCC.db schema fixture tests; report write failures correctly - #83

Merged
jacobsalmela merged 1 commit into
mainfrom
tcc-fixture-tests
Sep 27, 2026
Merged

jacobsalmela merged 1 commit into
mainfrom
tcc-fixture-tests

Conversation

@jacobsalmela

Copy link
Copy Markdown
Owner

Tests

  • tests/fixtures/.sql: TCC.db schemas copied verbatim from real Macs (schema only, no rows), starting with f773496775 from macOS 26.6.2.
  • tests/fixtures/harvest.sh: produces a fixture from a Mac's user or system TCC.db using only built-in tools.
  • tests/test_tccutil.py: replays each fixture into a temporary database and runs tccutil.py against it as that fixture's macOS version: --digest, insert, list, enable/disable, remove, and failed writes. Supported digests without a fixture are reported as a skipped test.
  • .github/workflows/tests.yml: runs the tests on Python 3.9 and 3.x.

Fix

  • A failed insert/remove/enable/disable printed "readonly database ... disable SIP" for any OperationalError and still exited 0, while other sqlite errors crashed with a traceback. Now the SIP hint is shown only for read-only errors, any other database error is reported as-is, and both exit 1.

Bump util_version to 1.5.4.

Tests
- tests/fixtures/<digest>.sql: TCC.db schemas copied verbatim from real
  Macs (schema only, no rows), starting with f773496775 from macOS 26.6.2.
- tests/fixtures/harvest.sh: produces a fixture from a Mac's user or
  system TCC.db using only built-in tools.
- tests/test_tccutil.py: replays each fixture into a temporary database
  and runs tccutil.py against it as that fixture's macOS version:
  --digest, insert, list, enable/disable, remove, and failed writes.
  Supported digests without a fixture are reported as a skipped test.
- .github/workflows/tests.yml: runs the tests on Python 3.9 and 3.x.

Fix
- A failed insert/remove/enable/disable printed "readonly database ...
  disable SIP" for any OperationalError and still exited 0, while other
  sqlite errors crashed with a traceback. Now the SIP hint is shown only
  for read-only errors, any other database error is reported as-is, and
  both exit 1.

Bump util_version to 1.5.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jacobsalmela
jacobsalmela merged commit a550a28 into main Sep 27, 2026
4 checks passed
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.

1 participant