Skip to content

e2e: default policy test#1007

Merged
jmxnzo merged 1 commit intomainfrom
e2e-no-policy-jla
Nov 21, 2024
Merged

e2e: default policy test#1007
jmxnzo merged 1 commit intomainfrom
e2e-no-policy-jla

Conversation

@jmxnzo
Copy link
Copy Markdown
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
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

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

@jmxnzo
Copy link
Copy Markdown
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
Copy Markdown
Member

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

@burgerdev
Copy link
Copy Markdown
Member

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
@jmxnzo jmxnzo deleted the e2e-no-policy-jla branch November 21, 2024 14:01
@jmxnzo
Copy link
Copy Markdown
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