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: controller pod restart recovery, FIPS enable/disable behavior, CoreDNS/OS-image updates (vSphere), certificate rotation/expiry checks, GPG key rotation, container runtime policy change validations, TLS/security hardening, and controller log integrity checks.
  • New Features

    • Added testing utilities for cluster-version detection, pod management (force pod removal), certificate expiry retrieval, machine-config list helpers, and 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: b28eaea0-2e53-4590-b039-3ef475c583e4

📥 Commits

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

📒 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 (3)
  • test/extended-priv/const.go
  • test/extended-priv/testdata/files/change-policy-json.yaml
  • test/extended-priv/testdata/files/change-fips.yaml
🚧 Files skipped from review as they are similar to previous changes (10)
  • test/extended-priv/testdata/files/add-gpg-pub-key.yaml
  • test/extended-priv/util/clusters.go
  • test/extended-priv/util.go
  • test/extended-priv/controller.go
  • test/extended-priv/mco.go
  • test/extended-priv/machineconfig.go
  • test/extended-priv/mco_daemon.go
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/mco_security.go
  • test/extended-priv/mco_kernel.go

Walkthrough

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

Changes

Extended MCO extended-priv test flow

Layer / File(s) Summary
Constants
test/extended-priv/const.go
Adds MCDCrioReloadedRegexp = "crio.* reloaded successfully".
Resource List Constructor
test/extended-priv/machineconfig.go
Adds NewMachineConfigList(oc *exutil.CLI) *MachineConfigList returning NewResourceList(oc, "mc").
Controller behavior
test/extended-priv/controller.go
Adds (*Controller).RemovePod() error which clears cached podName and deletes the cached machine-config-controller pod via CLI.
MachineConfigPool status parsing
test/extended-priv/machineconfigpool.go
Adds GetCertsExpiry() ([]CertExpiry, error) — reads .status.certExpirys and JSON-unmarshals into []CertExpiry.
MCO infra helper
test/extended-priv/mco.go
Adds getCoreDNSWorkerPodCreationTime(oc *exutil.CLI) (string, error) — queries CoreDNS pods, filters by name/node, returns latest creation timestamp.
Utilities: 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); imports io, net/http.
Utilities: cluster version
test/extended-priv/util/clusters.go
Adds GetClusterVersion(oc *CLI) (string, string, error) — reads and validates clusterversion desired version, returns X.Y and full version.
Test fixtures / templates
test/extended-priv/testdata/files/*
Adds three OpenShift Template fixtures: add-gpg-pub-key.yaml, change-fips.yaml, change-policy-json.yaml for GPG key, FIPS, and policy.json MachineConfig scenarios.
New test cases — daemon / disruptive
test/extended-priv/mco_daemon.go
Appends multiple g.It tests (pod removal and master labels/cordon, rpm-ostree race with kernel args, controller log noise absence, vSphere CoreDNS + osImage disruptive flow).
New test cases — kernel / FIPS
test/extended-priv/mco_kernel.go
Adds two serial disruptive tests: try enabling FIPS (expect degraded render) and refuse disabling FIPS (restore in defer + recover).
New test cases — security / certs / TLS
test/extended-priv/mco_security.go
Appends many disruptive/serial tests covering TLSv1.3 and cipher posture, GPG pubkey rotation without reboot, policy.json changes without drain/reboot, cert rotation paths (kube-apiserver signer, kube-apiserver-to-kubelet signer), ControllerConfig CA visibility, rbac-proxy cipher checks, and non-MC CA rotation checks. Includes log/assertion and node-side verifications.
Tests support / imports
multiple test files
Small supporting imports/changes (e.g., encoding/json, fmt, io, net/http) added where needed for new helpers and parsing.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

🚥 Pre-merge checks | ✅ 6 | ❌ 6

❌ Failed checks (6 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% 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 Test 68684 has %s placeholders without values in assertion messages. Tests 83943 and 82299 test multiple unrelated behaviors. Several assertions lack meaningful failure messages. Fix test 68684 assertion messages to include node names. Split tests 83943 and 82299 into focused tests. Add meaningful messages to all assertions.
Microshift Test Compatibility ⚠️ Warning 13 new tests use MachineConfig/MachineConfigPool (unavailable on MicroShift) with no skip protection. Add [apigroup:machineconfiguration.openshift.io] to test names or use [Skipped:MicroShift] labels/exutil.IsMicroShiftCluster() guards.
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning Seven tests assume worker pools or separate master/worker architecture. PolarionID:72132, 72135, 46965, 47062, 62084, 67395, 83943 will fail on SNO without guards. Add [Skipped:SingleReplicaTopology] labels to these test names or add exutil.IsSingleNode() checks with g.Skip() in test bodies.
Topology-Aware Scheduling Compatibility ⚠️ Warning getCoreDNSWorkerPodCreationTime() filters by "worker" node substring. On SNO/compact topologies with master nodes, function returns empty string, breaking test assertions on those topologies. Refactor getCoreDNSWorkerPodCreationTime() to accept MachineConfigPool or query all CoreDNS pods without node name filtering for topology-awareness across SNO, Two-Node, and HA topologies.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning Test PolarionID:43278 requires external GitHub connectivity via getGoVersion() function. This will fail in IPv6-only disconnected environments that have no public internet access. Either mock GitHub access in disconnected environments, use cluster-internal methods to fetch Go version info, or add [Skipped:Disconnected] to test name to automatically skip it on disconnected clusters.
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: migrating security, daemon, and kernel test cases from mco.go, with specific Jira issue references.
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 test cases use stable, deterministic titles. No dynamic values (pod names, timestamps, UUIDs, node names, IPs) found in titles. Dynamic values properly confined to test bodies.
Ote Binary Stdout Contract ✅ Passed No OTE Binary Stdout Contract violations found. All modified files properly handle logging via GinkgoWriter and contain no direct stdout writes at process level.

✏️ 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 from aacf393 to 95df15b Compare May 11, 2026 05:50
…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 95df15b to ffce562 Compare May 11, 2026 12:54
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 11, 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