Tests for external file path validation - #39
Open
Pyolar wants to merge 3 commits into
Open
Conversation
Two tests covering the DDL-time check of external table file paths against the ExternalFileAccess policy: - test_external_file_access_denied: CREATE TABLE with a path outside the restricted directory list must fail with SQLSTATE 28000 at CREATE TABLE time. - test_external_file_allowed_dir: a table inside the allowed directory still works, guarding against regressions. Both tests skip when ExternalFileAccess is not configured as a restricted list.
The tests previously relied on the ExternalFileAccess setting of the test environment and skipped when it was not a restricted list, which made them ineffective in the default QA configuration. Add dedicated databases.conf aliases with ExternalFileAccess restricted to the database directory, and derive the denied/allowed file paths from the actual database location at runtime. The tests no longer skip; a missing fix now fails them instead. Verified: 2 passed with the fix, 1 failed without it.
Drop the explicit user, password, async_write and do_not_drop parameters. The QA harness supplies credentials from the server configuration, and the database is removed by the fixture teardown as usual, so no leftover database is left between runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion tests for the firebird PR that validates external table file paths at metadata load time.
The tests are self-contained: they use dedicated databases.conf aliases with ExternalFileAccess restricted to the database directory, and derive the file paths from the actual database location at runtime. No external configuration is required and nothing is skipped.
Verified locally: 2 passed with the fix, denied test fails without it.
Corresponding fix: FirebirdSQL/firebird#9121