Skip to content

MCO-2209 MCO-2213 MCO-2233: Migrate security, daemon, and kernel TCs from mco.go#6021

Open
ptalgulk01 wants to merge 1 commit into
openshift:mainfrom
ptalgulk01:migrate-mco-security-daemon-kernel
Open

MCO-2209 MCO-2213 MCO-2233: Migrate security, daemon, and kernel TCs from mco.go#6021
ptalgulk01 wants to merge 1 commit into
openshift:mainfrom
ptalgulk01:migrate-mco-security-daemon-kernel

Conversation

@ptalgulk01
Copy link
Copy Markdown
Contributor

@ptalgulk01 ptalgulk01 commented May 8, 2026

Migrates 13 test cases from openshift-tests-private/test/extended/mco/mco.go into existing destination test suite files:

  • mco_security.go: 43278, 46965, 47062, 62084, 65208, 66436, 67395
  • mco_daemon.go: 68684, 82299, 83134, 83943
  • mco_kernel.go: 72132, 72135

New helpers/methods added to support these TCs:

  • getCommitID, getGoVersion (util.go)
  • getCoreDNSWorkerPodCreationTime (mco.go)
  • Controller.RemovePod (controller.go)
  • MachineConfigPool.GetCertsExpiry (machineconfigpool.go)
  • NewMachineConfigList (machineconfig.go)
  • exutil.GetClusterVersion (util/clusters.go)
  • MCDCrioReloadedRegexp constant (const.go)

Template files added: add-gpg-pub-key.yaml, change-policy-json.yaml, change-fips.yaml

Summary by CodeRabbit

  • Tests

    • Added many long-duration/disruptive MCO tests covering controller pod restart recovery, FIPS enable/disable scenarios, CoreDNS/OS-image updates (vSphere), certificate rotation/expiry checks, GPG key rotation, container runtime policy changes, TLS/security hardening, and controller log integrity checks.
  • New Features

    • Added testing utilities for cluster-version detection, pod removal, certificate-expiry retrieval, machine-config listing, and new test templates for GPG key, FIPS, and policy changes.

@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

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 8, 2026

@ptalgulk01: This pull request references MCO-2209 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

This pull request references MCO-2213 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

This pull request references MCO-2233 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Migrates 13 test cases from openshift-tests-private/test/extended/mco/mco.go into existing destination test suite files:

  • mco_security.go: 43278, 46965, 47062, 62084, 65208, 66436, 67395
  • mco_daemon.go: 68684, 82299, 83134, 83943
  • mco_kernel.go: 72132, 72135

New helpers/methods added to support these TCs:

  • getCommitID, getGoVersion (util.go)
  • getCoreDNSWorkerPodCreationTime (mco.go)
  • Controller.RemovePod (controller.go)
  • MachineConfigPool.GetCertsExpiry (machineconfigpool.go)
  • NewMachineConfigList (machineconfig.go)
  • exutil.GetClusterVersion (util/clusters.go)
  • MCDCrioReloadedRegexp constant (const.go)

Template files added: add-gpg-pub-key.yaml, change-policy-json.yaml, change-fips.yaml

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1e66b93d-9a28-4f0a-84d0-ef7668a777f2

📥 Commits

Reviewing files that changed from the base of the PR and between ffce562 and 58886d6.

📒 Files selected for processing (13)
  • test/extended-priv/const.go
  • test/extended-priv/controller.go
  • test/extended-priv/machineconfig.go
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/mco.go
  • test/extended-priv/mco_daemon.go
  • test/extended-priv/mco_kernel.go
  • test/extended-priv/mco_security.go
  • test/extended-priv/testdata/files/add-gpg-pub-key.yaml
  • test/extended-priv/testdata/files/change-fips.yaml
  • test/extended-priv/testdata/files/change-policy-json.yaml
  • test/extended-priv/util.go
  • test/extended-priv/util/clusters.go
✅ Files skipped from review due to trivial changes (1)
  • test/extended-priv/testdata/files/change-policy-json.yaml
🚧 Files skipped from review as they are similar to previous changes (12)
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/machineconfig.go
  • test/extended-priv/const.go
  • test/extended-priv/testdata/files/change-fips.yaml
  • test/extended-priv/mco.go
  • test/extended-priv/controller.go
  • test/extended-priv/util.go
  • test/extended-priv/testdata/files/add-gpg-pub-key.yaml
  • test/extended-priv/util/clusters.go
  • test/extended-priv/mco_kernel.go
  • test/extended-priv/mco_daemon.go
  • test/extended-priv/mco_security.go

Walkthrough

Adds test helpers, constructors, parsing utilities and ~10+ new disruptive/serial extended-priv Ginkgo tests plus YAML test templates for MCO scenarios (security hardening, FIPS, cert rotation, daemon resilience, kernel args, CoreDNS/osImage flows).

Changes

Extended MCO extended-priv test flow

Layer / File(s) Summary
Controller constant and pod removal
test/extended-priv/const.go, test/extended-priv/controller.go
Adds MCDCrioReloadedRegexp = "crio.* reloaded successfully" and (*Controller).RemovePod() error which clears cached podName and deletes the machine-config-controller pod.
Resource List Constructor
test/extended-priv/machineconfig.go
Adds NewMachineConfigList(oc *exutil.CLI) *MachineConfigList returning NewResourceList(oc, "mc").
MachineConfigPool cert expiry parsing
test/extended-priv/machineconfigpool.go
Imports encoding/json and adds GetCertsExpiry() ([]CertExpiry, error) to fetch and unmarshal .status.certExpirys.
MCO infra helper
test/extended-priv/mco.go
Adds getCoreDNSWorkerPodCreationTime(oc *exutil.CLI) (string, error) to compute latest creationTimestamp for worker CoreDNS pods in vSphere infra namespace.
Daemon disruptive tests
test/extended-priv/mco_daemon.go
Appends disruptive g.It tests: machine-config-controller pod removal/master label checks, rpm-ostree race with kernel args, controller log-integrity assertions, and vSphere CoreDNS + osImage disruptive flow.
Kernel / FIPS tests
test/extended-priv/mco_kernel.go
Adds two serial disruptive tests to attempt enabling FIPS (expect degraded render) and to assert refusal to disable FIPS (restore in defer + recover).
Security / certs / TLS tests
test/extended-priv/mco_security.go
Appends many serial disruptive tests for TLSv1.3 and cipher posture, GPG pubkey rotation without reboot, policy.json changes without reboot, paused-pool cert rotation flows, ControllerConfig certificate validation, rbac-proxy cipher checks, and non-MC CA rotation checks.
Testdata templates
test/extended-priv/testdata/files/*
Adds templates add-gpg-pub-key.yaml, change-fips.yaml, and change-policy-json.yaml for GPG key, FIPS, and policy.json MachineConfig scenarios.
Release & Go-version helpers
test/extended-priv/util.go
Adds getCommitID(oc *exutil.CLI, component, clusterVersion string) (string, error) and getGoVersion(component, commitID string) (float64, error) and imports io, net/http.
Cluster version helper
test/extended-priv/util/clusters.go
Adds GetClusterVersion(oc *CLI) (string, string, error) — reads desired clusterversion, validates format, returns short X.Y and full version.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Suggested labels: lgtm

🚥 Pre-merge checks | ✅ 7 | ❌ 5

❌ Failed checks (5 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Multiple test assertions lack meaningful error messages, violating requirement #4. PolarionID:43278 has 6/9 assertions without messages, PolarionID:46965 has 3/7, PolarionID:47062 has 4/10. Add error messages to all Expect assertions. Example: change o.Expect(err).NotTo(o.HaveOccurred()) to o.Expect(err).NotTo(o.HaveOccurred(), "failed to get version").
Microshift Test Compatibility ⚠️ Warning 13 new tests use MachineConfig/MachineConfigPool from machineconfiguration.openshift.io API group, unavailable on MicroShift. None have protection tags. Add [apigroup:machineconfiguration.openshift.io] tags to all 13 new test cases (PolarionIDs: 68684, 82299, 83134, 83943, 72132, 72135, 43278, 46965, 47062, 62084, 65208, 66436, 67395) to skip them on MicroShift.
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning Tests PolarionID:46965 and PolarionID:47062 in mco_security.go call GetAllLinuxWorkerNodesOrFail()[0] without SNO protection, which will fail on SNO if the node lacks the worker label. Add exutil.SkipOnSingleNodeTopology(oc) at the start of tests 46965 and 47062, or use GetCompactCompatiblePool() which is SNO-aware instead of GetAllLinuxWorkerNodesOrFail().
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning Test PolarionID:43278 requires external internet connectivity to raw.githubusercontent.com to fetch go.mod files, which will fail in IPv6-only disconnected environments. Add [Skipped:Disconnected] tag to test 43278, mock the getGoVersion function, or use cluster-internal metadata instead of fetching from GitHub.
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main objective of the PR: migrating test cases for security, daemon, and kernel from mco.go to dedicated test suite files, using specific Jira issue identifiers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All 13 new Ginkgo tests use stable, deterministic names. No dynamic values, fmt.Sprintf(), variable interpolation, or generated identifiers in test titles.
Topology-Aware Scheduling Compatibility ✅ Passed PR is test code migration only. No deployment manifests, operator code, or controllers with scheduling constraints added. All changes confined to test/extended-priv/.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes detected. All new code consists of constants, helper functions, or Ginkgo v2 test cases with proper framework encapsulation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@openshift-ci openshift-ci Bot requested review from RishabhSaini and yuqi-zhang May 8, 2026 13:29
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ptalgulk01
Once this PR has been reviewed and has the lgtm label, please assign cheesesashimi 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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 11

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/extended-priv/machineconfigpool.go`:
- Around line 1086-1092: GetCertsExpiry currently calls json.Unmarshal on
expiryString which can be empty (mcp.Get returns ""), causing "unexpected end of
JSON input"; before calling json.Unmarshal in GetCertsExpiry, check if
strings.TrimSpace(expiryString) == "" (or expiryString == "") and return an
empty slice (or nil) and nil error immediately; then proceed to json.Unmarshal
into certsExp as before. Ensure you reference the certsExp variable and the
GetCertsExpiry function when making this change and add a strings import if
needed.

In `@test/extended-priv/mco_daemon.go`:
- Around line 414-417: The test currently checks mcc logs with
o.Eventually(mcc.GetLogs...).ShouldNot(o.And(resourceNotFoundErrorMsg,
listFailureErrorMsg)) which only fails when both messages are present; change
the assertion to use Or so it fails if either resourceNotFoundErrorMsg or
listFailureErrorMsg appears (i.e., replace the And(...) matcher with Or(...) in
the ShouldNot call referencing mcc.GetLogs, resourceNotFoundErrorMsg and
listFailureErrorMsg).
- Around line 350-353: Defer cleanup() is called before verifying err from
GetCompactCompatibleOrCustomPool which can cause a nil-func panic; move the
defer until after validating the call (i.e., after the
o.Expect(err).NotTo(o.HaveOccurred()) check) and/or assert cleanup is non-nil
before deferring it so that cleanup is only deferred when
GetCompactCompatibleOrCustomPool successfully returned a valid cleanup function.

In `@test/extended-priv/mco_kernel.go`:
- Around line 387-401: The Patch calls (mMc.Patch, wMc.Patch) and possibly other
operations are ignoring returned errors; update the FIPS-disable test path to
capture and check each Patch call's error return and fail the test immediately
on error (e.g., use t.Fatalf/require.NoError/ExpectNoError) so the test does not
continue asserting degraded state when a patch failed; do this for
mMc.Patch(...) (both fips=true revert and fips=false), wMc.Patch(...) (both
places), and ensure any call to
wMcp.RecoverFromDegraded()/mMcp.RecoverFromDegraded() also surfaces errors if
they return any.

In `@test/extended-priv/mco_security.go`:
- Around line 1119-1121: The Eventually call using
o.Eventually(certSecret.GetDataValueOrFail).WithArguments("tls.crt").ShouldNot(o.Equal(initialCert))
needs an explicit timeout and polling interval to avoid flakes; update the chain
on certSecret.GetDataValueOrFail / initialCert to include e.g.
.WithTimeout(2*time.Minute).WithPolling(5*time.Second) (or other suitable
duration values) before ShouldNot so the test waits long enough for certificate
rotation.
- Around line 992-1007: The test's comment and intent state ">= 1.15" but the
assertion uses BeNumerically(">", 1.15), excluding 1.15; update the assertion on
goVersion (returned by getGoVersion) to
o.Expect(goVersion).Should(o.BeNumerically(">=", 1.15)) and adjust the nearby
logger message (the logger.Infof call that prints goVersion) or the preceding
comment to consistently state ">= 1.15" so the intent, log output, and the
o.Expect check (in the test block that calls getCommitID and getGoVersion for
machine-config-operator) all match.
- Around line 1228-1240: The test is order-dependent because it compares
certsExpiry[i] to ccKCertsInfo[i]; change the loop to match entries by a stable
key (e.g., Bundle or Subject) instead of by index: build an index map from
certsExpiry (map[bundle]expiry or map[subject]expiry) and then iterate
ccKCertsInfo, lookup the corresponding cert expiry from that map and assert
Bundle, Expiry, and Subject equality for the matched entry; reference
ccKCertsInfo, certsExpiry, and certExpry when locating the code to modify.

In `@test/extended-priv/mco.go`:
- Around line 188-196: The loop over pods can panic because nodes[i] is accessed
without ensuring i < len(nodes); add a bounds check similar to the timestamps
guard (e.g., ensure i < len(nodes) before using nodes[i]) or skip/continue when
the pod's corresponding nodeName is missing/empty so you never index past nodes;
update the block that checks strings.HasPrefix(pod, "coredns-") &&
strings.Contains(nodes[i], "worker") to first verify i < len(nodes) (or validate
nodeName per-pod) before inspecting nodes[i], leaving the existing timestamps
check intact.

In `@test/extended-priv/util.go`:
- Around line 1329-1342: The getGoVersion function currently shells out
(exec.Command with bash -c) and slices the curl output unsafely; replace that
with a safe HTTP GET using net/http (e.g., build the URL with fmt.Sprintf and
use http.Get), check for non-200 responses and read the body into a string, then
scan lines to find the first line starting with "go" (use strings.HasPrefix) and
validate its length before slicing; split that line by whitespace or "." to
extract the X and Y components (ensure at least two components), trim
newline/space, and use strconv.ParseFloat on the "X.Y" string, returning clear
errors on HTTP failures, missing go line, or bad version format—do all parsing
in getGoVersion (no shelling out) to avoid shell injection and
index-out-of-range panics.
- Around line 1316-1327: The getCommitID function builds a shell command with
exec.Command("bash", "-c", ...) using outFilePath and component which permits
shell injection; replace the shell pipeline with native Go: use the outFilePath
returned by OutputToFile to open and read the file, iterate its lines, find the
line that contains the exact component string (use strings.Contains or fields
parsing to match the component field), split the matching line into fields
(e.g., strings.Fields) and extract the third field as the commit ID, trim
newline with strings.TrimSpace and return it; keep error returns from
getPullSecret and oc.AsAdmin().WithoutNamespace().Run(...).OutputToFile and
propagate file I/O or parsing errors from getCommitID.

In `@test/extended-priv/util/clusters.go`:
- Around line 99-101: The code assumes clusterBuild and splitValues have at
least two dot-separated segments and that the jsonpath returns a single token;
add defensive checks in the function that computes clusterVersion: after
retrieving clusterBuild (from the oc get clusterversion jsonpath call) trim
whitespace, ensure it is non-empty and does not contain multiple space-separated
tokens (return an explicit error if it does), then call strings.Split and verify
len(splitValues) >= 2 before accessing splitValues[0] and splitValues[1]; if the
format is unexpected return a clear error instead of panicking. Also tighten the
jsonpath used to fetch desired.version (avoid recursive `..desired.version`) so
it returns a single precise value, and update any callers that expect
(clusterVersion, clusterBuild, err) accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: acaa2d9f-bcba-4746-9d9e-327dcfbc9367

📥 Commits

Reviewing files that changed from the base of the PR and between f9d91f6 and aacf393.

📒 Files selected for processing (13)
  • test/extended-priv/const.go
  • test/extended-priv/controller.go
  • test/extended-priv/machineconfig.go
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/mco.go
  • test/extended-priv/mco_daemon.go
  • test/extended-priv/mco_kernel.go
  • test/extended-priv/mco_security.go
  • test/extended-priv/testdata/files/add-gpg-pub-key.yaml
  • test/extended-priv/testdata/files/change-fips.yaml
  • test/extended-priv/testdata/files/change-policy-json.yaml
  • test/extended-priv/util.go
  • test/extended-priv/util/clusters.go

Comment on lines +1086 to +1092
var certsExp []CertExpiry

jsonerr := json.Unmarshal([]byte(expiryString), &certsExp)

if jsonerr != nil {
return nil, jsonerr
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

GetCertsExpiry returns a spurious JSON error when the MCP has no certExpirys

When status.certExpirys is absent, mcp.Get(...) returns an empty string with no error. json.Unmarshal([]byte(""), ...) then returns unexpected end of JSON input, making callers believe the MCP is broken rather than simply having no certificate data yet.

🛡️ Proposed fix
 var certsExp []CertExpiry
+if expiryString == "" {
+    return certsExp, nil
+}

 jsonerr := json.Unmarshal([]byte(expiryString), &certsExp)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var certsExp []CertExpiry
jsonerr := json.Unmarshal([]byte(expiryString), &certsExp)
if jsonerr != nil {
return nil, jsonerr
}
var certsExp []CertExpiry
if expiryString == "" {
return certsExp, nil
}
jsonerr := json.Unmarshal([]byte(expiryString), &certsExp)
if jsonerr != nil {
return nil, jsonerr
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/extended-priv/machineconfigpool.go` around lines 1086 - 1092,
GetCertsExpiry currently calls json.Unmarshal on expiryString which can be empty
(mcp.Get returns ""), causing "unexpected end of JSON input"; before calling
json.Unmarshal in GetCertsExpiry, check if strings.TrimSpace(expiryString) == ""
(or expiryString == "") and return an empty slice (or nil) and nil error
immediately; then proceed to json.Unmarshal into certsExp as before. Ensure you
reference the certsExp variable and the GetCertsExpiry function when making this
change and add a strings import if needed.

Comment thread test/extended-priv/mco_daemon.go
Comment on lines +414 to +417
o.Eventually(mcc.GetLogs, "1m", "20s").ShouldNot(o.And(
o.ContainSubstring(resourceNotFoundErrorMsg),
o.ContainSubstring(listFailureErrorMsg)),
"MCC is reporting that some resources cannot be found or listed")
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 8, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use Or for independent MCC log error conditions

Line 414 currently uses ShouldNot(o.And(...)), which still passes when only one failure signal is present. The intent here is to fail if either error appears.

Suggested fix
-		o.Eventually(mcc.GetLogs, "1m", "20s").ShouldNot(o.And(
+		o.Eventually(mcc.GetLogs, "1m", "20s").ShouldNot(o.Or(
 			o.ContainSubstring(resourceNotFoundErrorMsg),
 			o.ContainSubstring(listFailureErrorMsg)),
 			"MCC is reporting that some resources cannot be found or listed")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/extended-priv/mco_daemon.go` around lines 414 - 417, The test currently
checks mcc logs with
o.Eventually(mcc.GetLogs...).ShouldNot(o.And(resourceNotFoundErrorMsg,
listFailureErrorMsg)) which only fails when both messages are present; change
the assertion to use Or so it fails if either resourceNotFoundErrorMsg or
listFailureErrorMsg appears (i.e., replace the And(...) matcher with Or(...) in
the ShouldNot call referencing mcc.GetLogs, resourceNotFoundErrorMsg and
listFailureErrorMsg).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We need to check both the errors here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ptalgulk01, understood! The ShouldNot(o.And(...)) is intentional here — the test should only flag a problem when both "the server could not find the requested resource" and "failed to list" appear together in the MCC logs, as their co-occurrence is what indicates the specific resource-listing failure. Having either message alone may be acceptable. Thanks for the clarification!

Comment thread test/extended-priv/mco_kernel.go
Comment thread test/extended-priv/mco_security.go Outdated
Comment thread test/extended-priv/mco_security.go Outdated
Comment thread test/extended-priv/mco.go
Comment thread test/extended-priv/util.go
Comment thread test/extended-priv/util.go
Comment thread test/extended-priv/util/clusters.go Outdated
@ptalgulk01 ptalgulk01 force-pushed the migrate-mco-security-daemon-kernel branch 2 times, most recently from 95df15b to ffce562 Compare May 11, 2026 12:54
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2026
…from otp3 mco.go

Migrates 13 test cases from openshift-tests-private/test/extended/mco/mco.go
into existing destination test suite files:
- mco_security.go: 43278, 46965, 47062, 62084, 65208, 66436, 67395
- mco_daemon.go: 68684, 82299, 83134, 83943
- mco_kernel.go: 72132, 72135

New helpers/methods added to support these TCs:
- getCommitID, getGoVersion (util.go)
- getCoreDNSWorkerPodCreationTime (mco.go)
- Controller.RemovePod (controller.go)
- MachineConfigPool.GetCertsExpiry (machineconfigpool.go)
- NewMachineConfigList (machineconfig.go)
- exutil.GetClusterVersion (util/clusters.go)
- MCDCrioReloadedRegexp constant (const.go)

Template files added: add-gpg-pub-key.yaml, change-policy-json.yaml, change-fips.yaml

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ptalgulk01 ptalgulk01 force-pushed the migrate-mco-security-daemon-kernel branch from ffce562 to 58886d6 Compare May 19, 2026 16:58
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 19, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 19, 2026

@ptalgulk01: This pull request references MCO-2209 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

This pull request references MCO-2213 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

This pull request references MCO-2233 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "5.0." or "openshift-5.0.", but it targets "4.22.0" instead.

Details

In response to this:

Migrates 13 test cases from openshift-tests-private/test/extended/mco/mco.go into existing destination test suite files:

  • mco_security.go: 43278, 46965, 47062, 62084, 65208, 66436, 67395
  • mco_daemon.go: 68684, 82299, 83134, 83943
  • mco_kernel.go: 72132, 72135

New helpers/methods added to support these TCs:

  • getCommitID, getGoVersion (util.go)
  • getCoreDNSWorkerPodCreationTime (mco.go)
  • Controller.RemovePod (controller.go)
  • MachineConfigPool.GetCertsExpiry (machineconfigpool.go)
  • NewMachineConfigList (machineconfig.go)
  • exutil.GetClusterVersion (util/clusters.go)
  • MCDCrioReloadedRegexp constant (const.go)

Template files added: add-gpg-pub-key.yaml, change-policy-json.yaml, change-fips.yaml

Summary by CodeRabbit

  • Tests

  • Added many long-duration/disruptive MCO tests covering controller pod restart recovery, FIPS enable/disable scenarios, CoreDNS/OS-image updates (vSphere), certificate rotation/expiry checks, GPG key rotation, container runtime policy changes, TLS/security hardening, and controller log integrity checks.

  • New Features

  • Added testing utilities for cluster-version detection, pod removal, certificate-expiry retrieval, machine-config listing, and new test templates for GPG key, FIPS, and policy changes.

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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

@ptalgulk01: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants