Skip to content

test: add hostNetwork tests for both windows and linux#7984

Merged
dmcgowan merged 1 commit intocontainerd:mainfrom
aitumik:aitumik/add-host-network-tests
Feb 13, 2023
Merged

test: add hostNetwork tests for both windows and linux#7984
dmcgowan merged 1 commit intocontainerd:mainfrom
aitumik:aitumik/add-host-network-tests

Conversation

@aitumik
Copy link
Copy Markdown
Contributor

@aitumik aitumik commented Jan 23, 2023

Add the following tests for hostNetwork helper function

  • when host process is true in the PodSandboxConfig hostNetwork returns true
  • when host process is false in the PodSandboxConfig hostNetwork returns false

  • when network is pod hostNetwork returns false
  • when network is node hostNetwork returns true

@k8s-ci-robot
Copy link
Copy Markdown

Hi @aitumik. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@aitumik aitumik marked this pull request as draft January 23, 2023 14:56
@aitumik aitumik marked this pull request as ready for review January 23, 2023 15:43
@aitumik aitumik marked this pull request as draft January 23, 2023 16:29
@aitumik aitumik marked this pull request as ready for review January 25, 2023 10:40
@mxpv
Copy link
Copy Markdown
Member

mxpv commented Jan 26, 2023

A few comments:

@dcantah
Copy link
Copy Markdown
Member

dcantah commented Jan 26, 2023

This should resolve #7826

@dcantah dcantah added this to the 1.7 milestone Jan 26, 2023
@dcantah dcantah self-assigned this Jan 26, 2023
@dcantah
Copy link
Copy Markdown
Member

dcantah commented Jan 26, 2023

Could you please backport these tests to sbserver as well.

@aitumik If this was confusing, we split the CRI codebase in two while we work on an experimental feature here. This is where you'd need to duplicate your changes: https://github.com/containerd/containerd/tree/main/pkg/cri/sbserver. It should be a pretty easy copy and paste for that and the files are named the same. Thanks for working on this!

@aitumik aitumik force-pushed the aitumik/add-host-network-tests branch 5 times, most recently from 0f2b7b0 to 0d1a94f Compare January 29, 2023 14:27
@mxpv
Copy link
Copy Markdown
Member

mxpv commented Feb 7, 2023

Could you pls squash the commits?

@mxpv
Copy link
Copy Markdown
Member

mxpv commented Feb 7, 2023

/test pull-containerd-sandboxed-node-e2e

@aitumik aitumik force-pushed the aitumik/add-host-network-tests branch from 0d1a94f to ed9e747 Compare February 7, 2023 09:57
}

for _, tt := range tests {
if goruntime.GOOS != "windows" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this check? Go should exclude _windows_test.go on non-Windows platforms.

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.

No we don't need it actually. It is implicit in the filename making the changes..

Copy link
Copy Markdown
Member

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

Same comment as Maksym, otherwise LGTM

@aitumik aitumik force-pushed the aitumik/add-host-network-tests branch 2 times, most recently from 36d039d to 57645d4 Compare February 9, 2023 10:49
@dmcgowan
Copy link
Copy Markdown
Member

Can you try a rebase to see if we can get the windows tests passing. The errors don't seem related to your change, but I don't quite understand the failure either.

@dcantah
Copy link
Copy Markdown
Member

dcantah commented Feb 10, 2023

@dmcgowan It was this #8073, which was fixed by #8074. Rebase should resolve this like you said

@aitumik aitumik force-pushed the aitumik/add-host-network-tests branch 2 times, most recently from fb0cf63 to 0003939 Compare February 10, 2023 20:13
@aitumik aitumik force-pushed the aitumik/add-host-network-tests branch from 0003939 to 7cf5560 Compare February 10, 2023 21:15
@dmcgowan dmcgowan merged commit 164ac92 into containerd:main Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants