KNOX-3293: Add integration tests: health metrics JSON, KnoxLDAP preauth/extauthz paths, RemoteAuth extauthz#1194
Open
Raghav-Mah3shwari wants to merge 1 commit intoapache:masterfrom
Open
Conversation
…th/extauthz paths, RemoteAuth extauthz
pzampino
reviewed
Apr 7, 2026
| urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | ||
|
|
||
|
|
||
| def _base_url() -> str: |
Contributor
There was a problem hiding this comment.
Could this base URL logic and also the setting of the class member value be part of a common base class for all the tests? Same with the urllib3.disable_warnings statement?
Contributor
Author
There was a problem hiding this comment.
yes sure, i m working on restructuring the test flows, i will raise that in next pr
Test Results16 tests 16 ✅ 1s ⏱️ Results for commit ddb0574. |
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.
What changes were proposed in this pull request?
This PR adds integration tests under .github/workflows/tests that run against the Knox gateway in the workflow Docker Compose stack:
test_health.py — test_health_metrics_returns_json checks that GET /gateway/health/v1/metrics?pretty=true returns 200, a JSON Content-Type, and a parseable JSON object body.
test_knoxauth_preauth_and_paths.py — Covers KnoxLDAP preauth (401 without credentials / bad credentials; POST with valid credentials) and extauthz behavior when an additional path segment is not ignored (expects 404 vs treating it like the base extauthz URL).
test_remoteauth_extauthz_additional_path.py — Covers RemoteAuth extauthz: success with valid Basic auth and X-Knox-Actor-ID, additional path ignored when configured, 401 for bad credentials, and current behavior (500) when the Authorization header is missing.
How was this patch tested?
Built the workflow Knox image and ran the compose stack, then executed the integration test container (same flow as .github/workflows/tests/README.md).
Command (from the repo root, paths as in the README):
docker compose -f ./.github/workflows/compose/docker-compose.yml up --build --exit-code-from tests tests
Confirmed pytest collects and passes the new cases together with existing workflow tests (health ping, LDAP auth service, configs, remote auth, etc.).
Integration Tests
Yes. New/updated tests live under .github/workflows/tests: