USHIFT-6635: Add service account token CA bundle test#6268
USHIFT-6635: Add service account token CA bundle test#6268pacevedom wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@pacevedom: This pull request references Jira Issue OCPBUGS-77079, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this: 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. |
|
/hold |
📝 WalkthroughWalkthroughAdds a Robot Framework test suite that validates the service account CA bundle by extracting certificate subjects from a PEM ConfigMap and asserting required signers are present; includes suite setup/teardown, resources, variables, and a keyword that uses OpenSSL to extract subjects. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/suites/standard2/validate-service-account-ca-bundle.robot`:
- Around line 68-70: The test uses the Robot keyword Command Should Work to run
"grep -c 'BEGIN CERTIFICATE' ${ca_bundle_path}" but grep -c returns exit code 1
when there are zero matches, causing Command Should Work to fail earlier and
mask the intended numeric assertion; modify the command invoked via Command
Should Work so its pipeline cannot exit nonzero on zero matches (e.g., append
"|| echo 0" or "|| true" to the grep invocation) so ${stdout} still contains a
numeric count and the subsequent assertion (e.g., Should Be Equal As Integers)
can report the actual certificate count; update the line that produces ${stdout}
and keep the Log ${stdout} usage unchanged.
- Around line 21-37: The CA bundle subject/count helpers may fail on root-only
files; update the implementations of Get CA Bundle Subjects and Get CA Bundle
Certificate Count to run their subprocesses with sudo by prefixing the openssl
call in Get CA Bundle Subjects (the openssl crl2pkcs7 -nocrl -certfile ... |
openssl pkcs7 -print_certs -text -noout pipeline) with sudo and prefixing the
grep call in Get CA Bundle Certificate Count (grep -c 'BEGIN CERTIFICATE'
${ca_bundle_path}) with sudo so both commands read the bundle with elevated
privileges.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
test/suites/standard2/validate-service-account-ca-bundle.robot
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pacevedom The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2cebef0 to
8a271e5
Compare
8a271e5 to
e9474b0
Compare
|
@pacevedom: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/hold cancel |
|
@pacevedom: This pull request references USHIFT-6635 which is a valid jira issue. DetailsIn response to this:
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. |
Summary by CodeRabbit