KNOX-3296: Expand CI integration tests: health metrics, HSTS, and KnoxLDAP auth paths#1196
Merged
hanicz merged 3 commits intoapache:masterfrom Apr 10, 2026
Merged
Conversation
hanicz
requested changes
Apr 10, 2026
| response = knox_get(url) | ||
| self.assertEqual(response.status_code, 200) | ||
| content_type = response.headers.get("Content-Type", "") | ||
| self.assertIn("text/plain", content_type) |
Contributor
There was a problem hiding this comment.
Could you check for the actual content as well? (OK)
| url = self.base_url + "gateway/health/v1/metrics" | ||
| response = knox_get(url) | ||
| self.assertEqual(response.status_code, 200) | ||
| self.assertIn("application/json", response.headers.get("Content-Type", "")) |
Contributor
There was a problem hiding this comment.
It would make sense to check for the same payload keys as you did in the pretty test.
Test Results21 tests 21 ✅ 1s ⏱️ Results for commit 2d7ee8e. ♻️ This comment has been updated with latest results. |
hanicz
approved these changes
Apr 10, 2026
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 pull request extends .github/workflows/tests and the Docker Compose–based CI path so Knox is exercised with additional automated integration coverage:
test_health.py: Asserts /gateway/health/v1/metrics returns JSON (with and without pretty), checks top-level metric keys align with the Java health test expectations, and verifies /gateway/health/v1/ping responds with text/plain in addition to the existing ping and HSTS checks.
test_knoxauth_preauth_and_paths.py: Covers KnoxLDAP preauth (401 without or with bad credentials; 200 for POST/GET with valid credentials; x-knox-actor-username and group headers for admin) and verifies extauthz does not swallow unknown path segments (404 for a non-existent subpath).
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: