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

e2e: verify NROP machineconfigs are removed #1073

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rbaturov
Copy link
Contributor

Starting in version 4.18, NROP MachineConfigs containing the custom SELinux policy are expected to be removed unless a specific annotation is set in the NUMAResourcesOperator CR to enforce the use of the custom (legacy) SELinux policy. To ensure this behavior, we added a test that verifies MachineConfigs are removed when the annotation is absent in the CR.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2024
Copy link
Contributor

openshift-ci bot commented Nov 14, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Nov 14, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rbaturov
Once this PR has been reviewed and has the lgtm label, please assign mrniranjan for approval. 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

@rbaturov
Copy link
Contributor Author

/test all

@rbaturov rbaturov changed the title e2e: test machineconfigs are removed custom policy enabled e2e: verify NROP machineconfigs are removed Nov 14, 2024
@rbaturov rbaturov marked this pull request as ready for review November 17, 2024 08:44
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 17, 2024
@rbaturov
Copy link
Contributor Author

/retest-required

@@ -143,6 +144,21 @@ var _ = Describe("[Install] continuousIntegration", func() {
rteContainer, err := findContainerByName(*ds, containerNameRTE)
Expect(err).ToNot(HaveOccurred())
Expect(rteContainer.SecurityContext.SELinuxOptions.Type).To(Equal(selinux.RTEContextType), "container %s is running with wrong selinux context", rteContainer.Name)

By("checking numaresources machineconfigs removed when no SELinux policy annotation is present")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this test deserves to be running on a suite of its own which will be targeted for the an upgrade lane: openshift/release#58457
@ffromani WDYT?

Name: objectnames.GetMachineConfigName(updatedNROObj.Name, mcp.Name),
}
err := e2eclient.Client.Get(context.TODO(), mcKey, mc)
Expect(errors.IsNotFound(err)).To(BeTrue(), "MachineConfig %s is expected to not be found", mcKey.String())
Copy link
Member

Choose a reason for hiding this comment

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

we are looking to find err !=nil too:
Expect(err).To(HaveOccurred())
let's also print out the error we got instead if it is other than NotFound

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch Shereen thanks

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 25, 2024
Starting in version 4.18, NROP MachineConfigs containing the custom SELinux policy are expected to be removed unless a specific annotation is set in the NUMAResourcesOperator CR to enforce the use of the custom (legacy) SELinux policy. To ensure this behavior, we added a test that verifies MachineConfigs are removed when the annotation is absent in the CR.

Signed-off-by: Ronny Baturov <[email protected]>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 25, 2024
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.

4 participants