Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e test for Broker authorization #8132

Merged
merged 6 commits into from
Aug 8, 2024

Conversation

creydr
Copy link
Member

@creydr creydr commented Aug 7, 2024

Fixes #8131

Proposed Changes

  • 🎁 Run authorization tests as part of e2e test suite (test with AuthZ in their name)
  • 🎁 Add e2e tests for Broker authorization

@creydr creydr requested review from pierDipi and Leo6Leo August 7, 2024 11:00
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 7, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.89%. Comparing base (7237233) to head (05e7dc1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8132   +/-   ##
=======================================
  Coverage   67.89%   67.89%           
=======================================
  Files         368      368           
  Lines       17570    17570           
=======================================
  Hits        11929    11929           
  Misses       4893     4893           
  Partials      748      748           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

test/e2e-rekt-tests.sh Outdated Show resolved Hide resolved
@creydr creydr force-pushed the add-authz-e2e-test-for-broker branch from f097b87 to 09e4476 Compare August 7, 2024 11:37
@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 7, 2024
@creydr
Copy link
Member Author

creydr commented Aug 7, 2024

Running E2E Authorization Reconciler Tests
configmap/config-features unchanged
Running go test with args: -tags=e2e -count=1 -race -timeout=1h ./test/rekt -run AuthZ
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Prerequisite/should_not_run_when_Istio_is_enabled (0.05s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Prerequisite/transport_encryption_is_strict (0.06s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Prerequisite/OIDC_Authentication_is_enabled (0.06s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Prerequisite (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Setup/Install_Broker (0.14s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Setup/Install_the_Trigger (0.14s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Setup/Broker_is_addressable (3.10s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Setup/Broker_is_ready (3.10s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Setup/Install_the_EventPolicy (7.26s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Setup/Install_Sink (23.24s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Setup (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Requirement/Install_Pingsource (0.14s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Requirement/PingSource_goes_ready (3.10s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Requirement (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Assert/Broker_accepts_event_from_valid_sender (36.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Assert (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender/Teardown (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_accepts_events_from_a_authorized_sender (62.40s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Prerequisite/OIDC_Authentication_is_enabled (0.04s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Prerequisite/transport_encryption_is_strict (0.04s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Prerequisite/should_not_run_when_Istio_is_enabled (0.04s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Prerequisite (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup/Install_the_Trigger (0.24s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup/Install_an_EventPolicy (0.25s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup/Install_Broker (0.26s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup/Broker_is_ready (3.12s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup/Trigger_goes_ready (3.12s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup/Broker_is_addressable (3.13s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup/Install_Sink (16.15s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Setup (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Requirement/Install_Source (4.16s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Requirement (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Assert/Broker_broker_rejects_event_with_a_403_response (3.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Assert/Broker_event_is_sent (3.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Assert (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender/Teardown (0.00s)
PASS test/rekt.TestBrokerSupportsAuthZ/Broker_supports_authorization/Broker_rejects_events_from_an_unauthorized_sender (23.36s)
PASS test/rekt.TestBrokerSupportsAuthZ (96.26s)
PASS test/rekt

DONE 38 tests in 101.715s
Finished run, return code is 0

@creydr creydr force-pushed the add-authz-e2e-test-for-broker branch from 09e4476 to 05e7dc1 Compare August 7, 2024 15:10
@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 7, 2024
@creydr creydr requested a review from pierDipi August 7, 2024 19:46
@creydr
Copy link
Member Author

creydr commented Aug 8, 2024

/cc @rahulii

@knative-prow knative-prow bot requested a review from rahulii August 8, 2024 11:20
Copy link
Contributor

@rahulii rahulii left a comment

Choose a reason for hiding this comment

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

Looks awesome. Great PR @creydr.

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 8, 2024
Copy link

knative-prow bot commented Aug 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, rahulii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot merged commit b58b30d into knative:main Aug 8, 2024
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add e2e test for Broker authorization
3 participants