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: default policy test #1007

Merged
merged 1 commit into from
Nov 21, 2024
Merged

e2e: default policy test #1007

merged 1 commit into from
Nov 21, 2024

Conversation

jmxnzo
Copy link
Contributor

@jmxnzo jmxnzo commented Nov 18, 2024

Podvms come with a default policy, which should usually be a "SetPolicy only" policy. The implemented e2e test ensures that no wrong default policy (i.e. allow-all) is included, by starting a container without any policy annotation and waiting for the Kata runtime event FailedCreatePodSandBox, which indicates that the container start failed as expected.

  1. waitForEvent() was added to deploy.go, following the same pattern as waitFor(), but focusing on watching the eventList and no resource
  2. checkIfStartingBlocked() checks if the FailedCreatePodSandBox event with the expected message occurred

Copy link
Contributor

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

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

Please also proof-read your code comments.

e2e/internal/kubeclient/deploy.go Show resolved Hide resolved
e2e/internal/kubeclient/deploy.go Outdated Show resolved Hide resolved
e2e/internal/kubeclient/deploy.go Outdated Show resolved Hide resolved
e2e/internal/kubeclient/deploy.go Outdated Show resolved Hide resolved
e2e/internal/kubeclient/deploy.go Outdated Show resolved Hide resolved
e2e/nopolicy/nopolicy_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

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

Please make sure to also push your changes when you're resolving review comments.

e2e/internal/kubeclient/deploy.go Outdated Show resolved Hide resolved
@jmxnzo
Copy link
Contributor Author

jmxnzo commented Nov 20, 2024

Please make sure to also push your changes when you're resolving review comments.

I'm sorry, i was working on the issue right now and resolved the conflicts while adapting the changes to the code base. Won't happen again.

Copy link
Contributor

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

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

LGTM, but please address outstanding comments.

e2e/internal/kubeclient/deploy.go Outdated Show resolved Hide resolved
e2e/policy/policy_test.go Outdated Show resolved Hide resolved
@burgerdev
Copy link
Contributor

Take a look at the requirements of https://github.com/edgelesssys/contrast/actions/runs/11934103702/workflow?pr=1007#L18-L24, too. Tests are usually no changelog.

@jmxnzo jmxnzo added the no changelog PRs not listed in the release notes label Nov 21, 2024
e2e: Add waiting mechanism and correct event watching/listing to default policy test

Structure changes to deploy.go

e2e: rework and fetch event from the watch.Event directly

e2e: Add default policy into policy test package
@jmxnzo jmxnzo merged commit 187ea01 into main Nov 21, 2024
10 checks passed
@jmxnzo jmxnzo deleted the e2e-no-policy-jla branch November 21, 2024 14:01
@jmxnzo
Copy link
Contributor Author

jmxnzo commented Nov 25, 2024

#1031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PRs not listed in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants