Skip to content

Isolate integration test settings to prevent clobbering user config#101

Merged
sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:fix-integration-tests-clobber-settings
May 21, 2026
Merged

Isolate integration test settings to prevent clobbering user config#101
sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:fix-integration-tests-clobber-settings

Conversation

@sarroutbi
Copy link
Copy Markdown
Contributor

The curl integration tests issue PUT requests to /api/settings/keylime and /api/settings/certificates, which trigger persist_settings() and overwrite ~/.config/keylime-webtool/settings.toml. This silently replaces the user's real Verifier/Registrar URLs with Mockoon test values and deletes the mTLS certificate configuration, causing real Keylime services to appear as DOWN after every pre-commit run.

Set KEYLIME_WEBTOOL_CONFIG to a temporary file before starting the test backend so all settings writes go to an isolated location. The temp file is removed in the cleanup trap.

The curl integration tests issue PUT requests to /api/settings/keylime
and /api/settings/certificates, which trigger persist_settings() and
overwrite ~/.config/keylime-webtool/settings.toml. This silently
replaces the user's real Verifier/Registrar URLs with Mockoon test
values and deletes the mTLS certificate configuration, causing real
Keylime services to appear as DOWN after every pre-commit run.

Set KEYLIME_WEBTOOL_CONFIG to a temporary file before starting the
test backend so all settings writes go to an isolated location. The
temp file is removed in the cleanup trap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@sarroutbi sarroutbi merged commit 1b6e143 into keylime-webtool:main May 21, 2026
12 checks passed
@sarroutbi sarroutbi deleted the fix-integration-tests-clobber-settings branch May 21, 2026 15:08
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