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 e2e tests on k8s environment #155

Merged
merged 1 commit into from
Jul 5, 2021

Conversation

ykulazhenkov
Copy link
Collaborator

This PR fixes e2e tests on k8s enviroment

DiscoverSriov() uses IsSupportedDevice() function from sriovv1
package which relies on sriovv1.NicIdMap.
After recent changes, NicIdMap is not a static map anymore.
Need to update NicIdMap configmap with InitNicIdMap() function
call before usage.

Modify GetNodeSecureBootState to accept namespace argument and path sriov-network-operator
namespace to it. This required to keep all things in a single namespace during e2e.

FIX GetNodeSecureBootState function to handle
"/host/sys/kernel/security/lockdown" file absence correctly.
This path will be unavailable if kernel is compiled without lockdown
feature.

DiscoverSriov uses IsSupportedDevice function from sriovv1
package which relies on sriovv1.NicIdMap.
After recent changes, NicIdMap is not a static map anymore.
Need to update NicIdMap configmap with InitNicIdMap() function
call before usage.

Modify GetNodeSecureBootState to accept namespace argument.
FIX GetNodeSecureBootState function to handle
"/host/sys/kernel/security/lockdown" file absence correctly.
This path will be unavailable if kernel is compiled without this
feature.

Signed-off-by: Yury Kulazhenkov <[email protected]>
@ykulazhenkov
Copy link
Collaborator Author

@SchSeba @pliurh PTAL, this change related to secure boot env fix and to changes for using ConfigMap for supported NICs

@@ -293,14 +299,14 @@ func GetNodeSecureBootState(clients *testclient.ClientSet, nodeName string) (boo
return false, err
}

stdout, stderr, err := pod.ExecCommand(clients, runningPod, "cat", "/host/sys/kernel/security/lockdown")
stdout, _, err := pod.ExecCommand(clients, runningPod, "cat", "/host/sys/kernel/security/lockdown")
Copy link
Collaborator

Choose a reason for hiding this comment

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

why did you remove the stderr check. I still can failed for other reason

Copy link
Collaborator Author

@ykulazhenkov ykulazhenkov Jul 1, 2021

Choose a reason for hiding this comment

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

This check is useless. Stderr will be always empty.

TTY option set to true that mean that stdout will be used for stderr also.

Check Goclient src

Also, If command completes with non zero exit code, then err will be not nil, so check for error should be enough to catch all unexpected failures.

@pliurh pliurh merged commit f239b05 into k8snetworkplumbingwg:master Jul 5, 2021
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.

5 participants