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

OCPBUGS-29894: Add test verifying that routers without the required CRLs are marked not ready #1053

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rfredette
Copy link
Contributor

@rfredette rfredette commented May 13, 2024

The new test should fail until openshift/router#595 is merged.
This is part of the fix for OCPBUGS-29894

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels May 13, 2024
@openshift-ci-robot
Copy link
Contributor

@rfredette: This pull request references Jira Issue OCPBUGS-29894, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lihongan

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This is part of the fix for OCPBUGS-29894

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label May 13, 2024
@openshift-ci openshift-ci bot requested review from lihongan, alebedev87 and Miciah May 13, 2024 19:17
@openshift-ci-robot
Copy link
Contributor

@rfredette: This pull request references Jira Issue OCPBUGS-29894, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lihongan

In response to this:

The new test should fail until openshift/router#595 is merged.
This is part of the fix for OCPBUGS-29894

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@rfredette rfredette force-pushed the ocpbugs-29894-crl-tests branch 2 times, most recently from 07a0f76 to e12ad7b Compare June 5, 2024 02:42
@Miciah
Copy link
Contributor

Miciah commented Jun 5, 2024

/assign

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 4, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 4, 2024
@lihongan
Copy link
Contributor

lihongan commented Sep 4, 2024

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 4, 2024
@rfredette rfredette force-pushed the ocpbugs-29894-crl-tests branch from e12ad7b to 8e39bd5 Compare September 16, 2024 18:15
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 16, 2024
Copy link
Contributor

openshift-ci bot commented Sep 16, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from miciah. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@Miciah
Copy link
Contributor

Miciah commented Sep 16, 2024

As noted in openshift/router#595 (review), I think we need an alert. Would it make sense to include that in this PR?

test/e2e/client_tls_test.go Outdated Show resolved Hide resolved
test/e2e/client_tls_test.go Outdated Show resolved Hide resolved
Namespace: namespaceName,
}
// When generating certificates, the CRL distribution points need to be specified by URL
crlHostServiceName := names.SimpleNameGenerator.GenerateName("crl-host-service-")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it useful to use a new generated name here, as opposed to using crlHostName.Name + "-service" or even just crlHostName.Name? Similarly, I think crlConfigMapName below could be generated as fmt.Sprintf("%s-%s", crlHostName.Name, name), and clientCAConfigmapName and icName could use the same prefix. I imagine tracing the test or diagnosing failures would be easier if it used the same prefix when naming resources related to the same test case.

Then there are clientCertsConfigmap, podName, echoPod, etc., but maybe it makes more sense for some of those to have distinct prefixes. That is, the echo pod, echo route, and echo service can (and do) share a prefix, but a different prefix from crlConfigMapName etc.

If I'm missing something or you find the current approach easier to follow, feel free to ignore this suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took the brute force approach to make sure there were no name conflicts when the subtests are run in parallel, but I agree, it'd be better be able to identify which resources are a part of the same subtest.

// Generate CRLs. Offset the expiration times by 1 minute each so that we can verify that only the correct CRLs get updated at each expiration.
currentCRLs := map[string]*x509.RevocationList{}
crlPems := map[string]string{}
caBundle := []string{}
validTime := 3 * time.Minute
//expirations := []time.Time{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Debug code?

test/e2e/client_tls_test.go Outdated Show resolved Hide resolved
Comment on lines +1204 to +1209
for i := range testCases {
tc := testCases[i]
Copy link
Contributor

@Miciah Miciah Sep 16, 2024

Choose a reason for hiding this comment

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

What's the point of this change? Did you mean to use tc := &testCases[i] to avoid copying the whole test case? Even that would be an unnecessary micro-optimization for test code, in my opinion, but I don't understand the purpose of writing for i := range testCases / tc := testCases[i] instead of keeping the original for _, tc := range testCases at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for _, tc := range testCases isn't thread safe. I initially had it that way, but once t.Parallel() was called, tc in all threads converged on the last test case in the list.

test/e2e/client_tls_test.go Outdated Show resolved Hide resolved
test/e2e/client_tls_test.go Outdated Show resolved Hide resolved
test/e2e/client_tls_test.go Outdated Show resolved Hide resolved
test/e2e/client_tls_test.go Outdated Show resolved Hide resolved
@rfredette rfredette force-pushed the ocpbugs-29894-crl-tests branch 2 times, most recently from f62a85a to 2536ff0 Compare September 24, 2024 02:27
Modify TestMTLSWithCRLs and TestCRLUpdate so that the subtests of each
test can be run in parallel.
TestRouterWaitsForCRLs verifies that the router reports not ready until
all required CRLs are downloaded

This is part of the fix for OCPBUGS-29894
@rfredette rfredette force-pushed the ocpbugs-29894-crl-tests branch from 2536ff0 to 258b656 Compare September 24, 2024 02:39
Copy link
Contributor

openshift-ci bot commented Sep 24, 2024

@rfredette: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure-operator 258b656 link true /test e2e-azure-operator
ci/prow/e2e-gcp-operator 258b656 link true /test e2e-gcp-operator
ci/prow/e2e-aws-operator-techpreview 258b656 link false /test e2e-aws-operator-techpreview
ci/prow/e2e-aws-ovn-single-node 258b656 link false /test e2e-aws-ovn-single-node
ci/prow/e2e-hypershift 258b656 link true /test e2e-hypershift
ci/prow/e2e-aws-operator 258b656 link true /test e2e-aws-operator

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@Miciah Miciah added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants