-
Notifications
You must be signed in to change notification settings - Fork 148
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
Basic E2E test, utils implementation and scripts to setup KinD cluster #196
base: master
Are you sure you want to change the base?
Basic E2E test, utils implementation and scripts to setup KinD cluster #196
Conversation
I looked into issue with CI, and this is something that does not happens when I call make test locally, because folder github.com/k8snetworkplumbingwg/sriov-cni/test/e2e was excluded from test on Makefile level. Need to check how github actions are triggering the build. |
@zshi-redhat @adrianchiris could you review? |
@adrianchiris @zshi-redhat Can we kick this off again? :) |
/cc @wizhaoredhat |
@MichalGuzieniuk great job! I think it would be great to have E2E tests in this project. However, I'm having trouble while running the preparation script
Maybe we can point to the new multus DaemonSet manifest? |
Done. updated URL. I am taking over this PR as Michal has moved on. |
Thank you. |
/retest |
1 similar comment
/retest |
lgtm |
WDYT? Ready to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall code seems OK.
Been trying to run this on a Mellanox NIC but without success.
all 3 tests fail with the same error:
___________________________________ START TEST WITH enp3s0f0 ___________________________________________
________________________________________________________________________________________________________
Tests are going to be run with PF enp3s0f0 interfaces within KinD network namespace: /var/run/docker/netns/cc02027f2eff on driver: kernel
Device Plugin configuration read from /usr/share/e2e/enp3s0f0-dp-config.json
=== RUN TestSriovTests
Running Suite: SR-IOV CNI E2E suite
===================================
Random Seed: 1650813914
Will run 3 of 3 specs
STEP: Store host links before tests
STEP: Create network attachment definition
STEP: Create POD
STEP: Delete network attachment definition
STEP: Get links after test and move those which were moved from Docker to host, once again to Docker netNs
_ Failure [30.094 seconds]
SR-IOV CNI test
/tmp/sriov-cni/test/e2e/sriov_smoke_test.go:18
Test with kernel Virtual Function driver
/tmp/sriov-cni/test/e2e/sriov_smoke_test.go:19
POD is able to consume SR-IOV interfaces
/tmp/sriov-cni/test/e2e/sriov_smoke_test.go:48
Second interface is available within POD [It]
/tmp/sriov-cni/test/e2e/sriov_smoke_test.go:49
Expected
<*errors.errorString | 0xc000290580>: {
s: "timed out waiting for the condition",
}
to be nil
/tmp/sriov-cni/test/e2e/sriov_smoke_test.go:56
------------------------------
I have added mlx5_core driver to: supportedKenrelDrivers
in e2e_test_suite_test.go
any pointers on how to debug this ?
go.mod
Outdated
github.com/vishvananda/netlink v1.0.1-0.20190924205540-07ace697bea4 | ||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect | ||
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.0 | ||
github.com/k8snetworkplumbingwg/sriov-network-operator v1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think we are actually using this.
also need to run go mod tidy
as i see differences when I ran on my machine
test/README.MD
Outdated
"selectors": { | ||
"vendors": ["8086"], | ||
"devices": ["154c"], | ||
"driver": ["iavf"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: drivers
test/e2e/sriov_smoke_test.go
Outdated
stdoutString, stderrString, err = pod.ExecuteCommand(cs.CoreV1Interface, kubeConfig, podObj.Name, *testNs, "test", "ethtool -i net1") | ||
Expect(err).Should(BeNil()) | ||
Expect(stderrString).Should(Equal("")) | ||
Expect(stdoutString).Should(ContainSubstring("driver: iavf")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should check if its in supportedKernelDrivers
list from e2e_test_suite_test.go
@adrianchiris it looks like for some reason the VF you are trying to use is not passed into the pod. |
@Eoghan1232 will it be possible to rebase this PR to fix the merge issues? |
2411820
to
098c529
Compare
Pull Request Test Coverage Report for Build 4668114029Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@SchSeba Done. Lint seems to be failing, but not an error due to PR. |
test/README.MD
Outdated
|
||
### How to test e2e | ||
|
||
To be able to execute Go tests it is necessary to create configuration files that will provide information about interface to be used in tests and configuration of device plugin. Based on that information scripts will execute tests. It is in responsibility of vendor that provides host to create those configuration files and prepare network interfaces with correct driver and sufficient number of Virtual Functions (VF). Test suite will NOT create any VFs on its own. After KinD initialization each VFs driver is checked against supported drivers array. It is not allowed to mix kernel space drivers with user space drivers on one Physical Function (PF). Vendors can update the driver array if needed by providing pull request with change. The array is defined inside **sriov-cni/test/e2e/e2e_tests_suite_test.go**. Test suite based on configuration tries to automatically detect the driver space and run tests suitable only for those drivers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: sriov-cni/test/e2e/e2e_test_suite_test.go
scripts/e2e_setup_cluster.sh
Outdated
RETRY_MAX=10 | ||
INTERVAL=10 | ||
TIMEOUT=300 | ||
MULTUS_DAEMONSET_URL="https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/images/multus-daemonset.yml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL is returing for 404, multus-daemonset.yml is deployments folder.
MULTUS_DAEMONSET_URL="https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset.yml"
test/README.MD
Outdated
### How to teardown cluster | ||
|
||
``` | ||
$ ./scripts/e2e_teardown.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ./scripts/e2e_teardown_cluster.sh
48b81f3
to
098c529
Compare
* add missing min_tx_rate to test podscpecs * fix golangci-lint * gofmt * switch to ginkgo v2 * use latest kind
Improve test stdout Fix tests for more than 16 VFs Better error when no VFs are setup
098c529
to
0dfba1c
Compare
can we close this one in favor of #282? |
This pull requests brings
Thus, the main purpose of this pull request is to provide an environment for tests. In following PRs a specific tests for each part of SRIOV-CNI functionality can be delivered.
Within PR you may also find a Github workflow that aims to run tests on self hosted runner. Currently this workflow is disable because there is no server with hardware connected to this repository. Once it is done, such workflow can be enabled.
In current state, scripts in this change can help to verify changes offline in the lab where hardware is available. For details how to pass information about network interface that should be used in tests please check test\Readme.