Skip to content

Add tests for mTLS configuration and functional behavior#675

Merged
emmaaroche merged 1 commit intoKuadrant:mainfrom
emmaaroche:mtls-config-e2e-tests
Jun 12, 2025
Merged

Add tests for mTLS configuration and functional behavior#675
emmaaroche merged 1 commit intoKuadrant:mainfrom
emmaaroche:mtls-config-e2e-tests

Conversation

@emmaaroche
Copy link
Copy Markdown
Contributor

@emmaaroche emmaaroche commented May 6, 2025

Description:

This PR introduces tests that validate Kuadrant's mTLS functionality.

The tests are grouped into configuration and functional behavior checks, and are applied across three scenarios:

  • AuthPolicy only
  • RateLimitPolicy only
  • Both policies applied together

Each scenario includes the following tests:

  • mTLS Functional Behavior Tests:

    • Ensures that requests succeed when mTLS is disabled
    • Verifies that requests continue to succeed when mTLS is enabled
    • Confirms that requests still succeed after mTLS is disabled again
  • mTLS Configuration Tests:

    • Verifies that PeerAuthentication with STRICT mode is created when mTLS is enabled
    • Confirms that the relevant pods have the necessary Istio sidecar and labels after mTLS is enabled
    • Ensures Kuadrant CR reaches Ready status after enabling mTLS

Related Issues / PR's:

#1230
#1329
#1170

@emmaaroche emmaaroche self-assigned this May 6, 2025
@emmaaroche emmaaroche added the Test case New test case label May 6, 2025
@emmaaroche emmaaroche requested a review from azgabur May 6, 2025 11:10
Copy link
Copy Markdown
Member

@azgabur azgabur left a comment

Choose a reason for hiding this comment

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

WIP Review

Comment thread testsuite/tests/singlecluster/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/test_mtls_configuration.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/test_mtls_configuration.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/test_mtls_configuration.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/test_mtls_configuration.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/test_mtls_configuration.py Outdated
Copy link
Copy Markdown
Member

@azgabur azgabur left a comment

Choose a reason for hiding this comment

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

test_mtls_configuration_with_* could be put in one file with some parametrization
same with test_mtls_functional_behavior_*

https://docs.pytest.org/en/7.1.x/example/parametrize.html

Or look how its done for example here:
testsuite/tests/kuadrantctl/cli/test_simple_route.py
or
testsuite/tests/singlecluster/authorino/operator/clusterwide/test_clusterwide.py

Comment thread testsuite/tests/singlecluster/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/test_mtls_configuration_with_authpolicy.py Outdated
Comment thread testsuite/tests/singlecluster/mtls/test_mtls_configuration_with_authpolicy.py Outdated
@emmaaroche emmaaroche force-pushed the mtls-config-e2e-tests branch from c3dbc9d to fc1902c Compare May 27, 2025 07:43
@emmaaroche emmaaroche requested a review from azgabur May 27, 2025 07:45
Copy link
Copy Markdown
Member

@azgabur azgabur left a comment

Choose a reason for hiding this comment

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

Good job with the parametrization!

Comment thread testsuite/tests/singlecluster/gateway/mtls/test_mtls_behaviour.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/mtls/test_mtls_behaviour.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/mtls/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/mtls/test_mtls_behaviour.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/mtls/test_mtls_behaviour.py
@emmaaroche emmaaroche force-pushed the mtls-config-e2e-tests branch from fc1902c to 98c716e Compare June 3, 2025 13:07
@emmaaroche emmaaroche requested a review from azgabur June 3, 2025 13:09
Comment thread testsuite/tests/singlecluster/gateway/mtls/conftest.py Outdated
Signed-off-by: emmaaroche <eroche@redhat.com>
@emmaaroche emmaaroche force-pushed the mtls-config-e2e-tests branch from 98c716e to 4d81b02 Compare June 12, 2025 11:21
@emmaaroche emmaaroche requested a review from azgabur June 12, 2025 11:22
Copy link
Copy Markdown
Member

@azgabur azgabur left a comment

Choose a reason for hiding this comment

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

LGTM, nice job 👍

@emmaaroche emmaaroche merged commit ef9661f into Kuadrant:main Jun 12, 2025
3 checks passed
@emmaaroche emmaaroche deleted the mtls-config-e2e-tests branch June 12, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Test case New test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add e2e tests for mTLS Configuration via Kuadrant CR

2 participants