Skip to content

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
Raghav-Mah3shwari:KNOX-3293
Open

KNOX-3293: Add integration tests: health metrics JSON, KnoxLDAP preauth/extauthz paths, RemoteAuth extauthz#1194
Raghav-Mah3shwari wants to merge 1 commit intoapache:masterfrom
Raghav-Mah3shwari:KNOX-3293

Conversation

@Raghav-Mah3shwari
Copy link
Copy Markdown
Contributor

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:

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


def _base_url() -> str:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sure, i m working on restructuring the test flows, i will raise that in next pr

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Test Results

16 tests   16 ✅  1s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit ddb0574.

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.

2 participants