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
bpf: make BPF unit tests reproducible #31526
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently, we develop the datapath against multiple versions of LLVM: various local (host) toolchains during development, CI uses an LLVM version installed by a GH workflow, and the agent uses the cilium-builder container image. This PR changes the BPF unit tests to use cilium-builder by default using the `run_bpf_tests` make target in the root Makefile of the project. Small overview of the changes: - run bpf unit tests CI using the cilium-builder image so we use the same LLVM toolchain across all tests - set -j<numcpu> on the root Docker invocation to build .o's in parallel, as building the tests was becoming rather slow - moved `test/bpf_tests/` to `bpf/tests/bpftest` to keep the BPF test runner closer to the .c test files it's used with - removed the layer of indirection through `test/Makefile`; the root Makefile now calls `bpf/tests/Makefile` directly - added a `run` target to `bpf/tests/Makefile` to make it easier to invoke the tests using the host Go toolchain without rebuilding the world. sudo is now used automatically for 'go test' if `make` is invoked as a non-root user. - cleaned up output generated by bpf/tests/Makefile Signed-off-by: Timo Beckers <timo@isovalent.com>
/test |
ti-mo
requested review from
aspsk,
christarazi,
jibi,
bimmlerd,
qmonnet and
aanm
March 20, 2024 15:15
ldelossa
reviewed
Mar 20, 2024
ldelossa
approved these changes
Mar 20, 2024
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.
Nice!
aspsk
approved these changes
Mar 20, 2024
christarazi
approved these changes
Mar 20, 2024
aanm
approved these changes
Mar 20, 2024
qmonnet
approved these changes
Mar 21, 2024
4 tasks
ti-mo
added
the
backport-pending/1.15
The backport for Cilium 1.15.x for this PR is in progress.
label
Mar 28, 2024
rgo3
removed
the
backport-pending/1.15
The backport for Cilium 1.15.x for this PR is in progress.
label
Apr 2, 2024
rgo3
added
the
backport-done/1.15
The backport for Cilium 1.15.x for this PR is done.
label
Apr 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-done/1.15
The backport for Cilium 1.15.x for this PR is done.
release-note/ci
This PR makes changes to the CI.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we develop the datapath against multiple versions of LLVM: various local (host) toolchains during development, CI uses an LLVM version installed by a GH workflow, and the agent uses the cilium-builder container image.
This PR changes the BPF unit tests to use cilium-builder by default using the
run_bpf_tests
make target in the root Makefile of the project.Small overview of the changes:
test/bpf_tests/
tobpf/tests/bpftest
to keep the BPF test runner closer to the .c test files it's used withtest/Makefile
; the root Makefile now callsbpf/tests/Makefile
directlyrun
target tobpf/tests/Makefile
to make it easier to invoke the tests using the host Go toolchain without rebuilding the world. sudo is now used automatically for 'go test' ifmake
is invoked as a non-root user.