Skip to content

Add GetSSHPaths unit tests covering EL10 (#6204) - #6394

Open
kchawlani19 wants to merge 1 commit into
openshift:mainfrom
kchawlani19:fix-6204-getsshpaths-el10-tests
Open

Add GetSSHPaths unit tests covering EL10 (#6204)#6394
kchawlani19 wants to merge 1 commit into
openshift:mainfrom
kchawlani19:fix-6204-getsshpaths-el10-tests

Conversation

@kchawlani19

@kchawlani19 kchawlani19 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

Test plan

  • go test ./test/helpers/ -run TestGetSSHPaths — PASS (all 6 subtests)
  • Full ./test/helpers/ — previously hit a pre-existing flaky timing assertion in TestAssertions (unrelated to this change)
  • E2E TestNoReboot — not run locally (requires a live OpenShift cluster)

Fixes #6204

Summary by CodeRabbit

  • Tests
    • Added coverage for SSH key path selection across RHCOS, EL10, CentOS Stream CoreOS, SCOS, and FCOS environments.
    • Verified both expected and excluded key paths using representative operating system configurations.

Lock in RHCOS9SSHKeyPath expectations for EL10 so TestNoReboot path
selection cannot regress back to the legacy RHCOS8 path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Walkthrough

Added parallel table-driven tests for GetSSHPaths. The tests cover RHCOS 8, RHCOS 9, EL10, CentOS Stream CoreOS 10, SCOS, and FCOS. Each case validates expected and excluded SSH key paths.

Changes

SSH path coverage

Layer / File(s) Summary
OS-release SSH path tests
test/helpers/utils_test.go
Added synthetic OS-release fixtures and parallel table-driven assertions for legacy and new SSH key paths, including EL10 detection.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The tests cover EL10 SSH path selection and prevent regression to the legacy path described in issue #6204.
Out of Scope Changes check ✅ Passed The changes are limited to GetSSHPaths tests and directly support issue #6204.
Stable And Deterministic Test Names ✅ Passed The added t.Run titles are literal, descriptive OS cases; they contain no runtime names, timestamps, UUIDs, nodes, namespaces, IPs, or other dynamic values.
Test Structure And Quality ✅ Passed The change is a standard testing/Testify unit test, not Ginkgo code; it has focused subtests, performs no cluster/resource operations, and uses no wait requiring a timeout.
Microshift Test Compatibility ✅ Passed The PR adds only a standard Go table-driven TestGetSSHPaths using testing and osrelease; it adds no Ginkgo e2e test or MicroShift-incompatible API usage.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The change adds only a standard Go TestGetSSHPaths(t *testing.T) with t.Run and synthetic OS-release data; it adds no Ginkgo e2e test or multi-node assumption.
Topology-Aware Scheduling Compatibility ✅ Passed The pull request adds only test/helpers/utils_test.go; it does not modify deployment manifests, operator code, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR adds only test/helpers/utils_test.go; it has no main, init, suite setup, logging, or stdout calls, and does not affect the OTE binary.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The only added file is a standard Go unit test using testing.T and synthetic os-release data; it adds no Ginkgo e2e constructs, IPv4 assumptions, or external connectivity.
No-Weak-Crypto ✅ Passed The PR adds only OS-release path-selection tests; the patch has no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret-comparison code.
Container-Privileges ✅ Passed The PR adds only a Go unit test. Its added lines contain no privileged, host namespace, SYS_ADMIN, privilege escalation, or root container settings.
No-Sensitive-Data-In-Logs ✅ Passed The only changed file is a unit test with synthetic OS-release data and path assertions; it adds no logging or credential, token, PII, hostname, or customer data output.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the added GetSSHPaths unit tests and highlights EL10 coverage, which matches the main change.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

@kchawlani19

Copy link
Copy Markdown
Author

/test bootstrap-unit

1 similar comment
@kchawlani19

Copy link
Copy Markdown
Author

/test bootstrap-unit

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@kchawlani19: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@kchawlani19

Copy link
Copy Markdown
Author

Hi! Could an MCO reviewer/approver take a look when you have a chance?
This adds TestGetSSHPaths coverage for EL10 (locks in the #6204 fix already on main).
Unit/verify/bootstrap-unit are green; e2e jobs are still running.
Thanks!
/cc @djoshy @dkhater-redhat

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.

e2e TestNoReboot fails on RHEL10: GetSSHPaths missing EL10 handling

1 participant