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

bpf: make BPF unit tests reproducible #31526

Merged
merged 1 commit into from
Mar 21, 2024
Merged

bpf: make BPF unit tests reproducible #31526

merged 1 commit into from
Mar 21, 2024

Commits on Mar 20, 2024

  1. bpf: make BPF unit tests reproducible

    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>
    ti-mo committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    6d2e12e View commit details
    Browse the repository at this point in the history