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

Fix sriov functional tests for secure boot env #148

Merged

Conversation

SchSeba
Copy link
Collaborator

@SchSeba SchSeba commented Jun 21, 2021

This commit fix the functional tests when running on a secure boot environment

Signed-off-by: Sebastian Sch sebassch@gmail.com

@SchSeba
Copy link
Collaborator Author

SchSeba commented Jun 21, 2021

/cc @fedepaol @mmirecki

@github-actions github-actions bot requested a review from fedepaol June 21, 2021 08:31
for _, itf := range s.Status.Interfaces {
if itf.Driver == "mlx5_core" {
if itf.Vendor == mlxVendorID {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why we need this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To support newer card versions that may use a different driver.

Better to go with the vendor ID

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!

}

var runningPod *corev1.Pod
for retry := 0; retry < 180; retry++ {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you use the backoff functions here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep done :)

podDefinition = pod.RedefineAsPrivileged(podDefinition)

volume := corev1.Volume{Name: "host", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/"}}}
mount := corev1.VolumeMount{Name: "host", MountPath: "/host"}
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 the sr-iov daemons already mount /host, would it be better to leverage those?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem is that they are doing chroot /host as part of the code so we can have some flakes if when we exec into the pod it was inside a chroot in another process.

I this is just safer and we are already starting pods as part of the tests so it should not be critical

This commit fix the functional tests when running on a secure boot environment

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
@SchSeba SchSeba force-pushed the fix_sriov_secure_boot_tests branch from 555288a to 1843e9b Compare June 21, 2021 13:20
@fedepaol
Copy link
Collaborator

/lgtm

@github-actions github-actions bot added the lgtm label Jun 21, 2021
@SchSeba
Copy link
Collaborator Author

SchSeba commented Jun 21, 2021

@mmirecki please take a look

@SchSeba SchSeba merged commit 271d952 into k8snetworkplumbingwg:master Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants