Commit Graph

10 Commits (13d47b8aff3989e2077a45f1d2c8924a2cb141d9)

Author SHA1 Message Date
Tamir Duberstein 13d47b8aff
integration-ebpf: artifact dependency bpf-linker
Replace the manual dependency machinery in integration-test/build.rs
with:

- integration-ebpf -[artifact-dependency]-> bpf-linker.
- integration-test -[build-dependency]-> integration-ebpf.
- integration-ebpf: build.rs that makes bpf-linker available to rustc.
- integration-ebpf: lib.rs (empty) creates a lib target, allows dep from
  integration-test.
- xtask: filter for test binaries now that the build also produces the
  bpf-linker binary.
- github: remove `cargo install bpf-linker` and commentary about cache
  invalidation.
- integration-test: remove bpf-linker installation instructions.
2 years ago
Andrew Werner af747f8caa test: update README.md
A checkout of libbpf is no longer required.
2 years ago
Tamir Duberstein 3d463a3610
integration-test: compile Rust probes using build.rs 2 years ago
Tamir Duberstein 8c61fc9ea6
integration-test: compile C probes using build.rs
- Add libbpf as a submodule. This prevents having to plumb its location
  around (which can't be passed to Cargo build scripts) and also
  controls the version against which codegen has run.
- Move bpf written in C to the integration-test crate and define
  constants for each probe.
- Remove magic; each C source file must be directly enumerated in the
  build script and in lib.rs.
2 years ago
Tamir Duberstein 9ca0af1a79
integration-test: Remove integration-test-macros
This doesn't add any value; use `cargo build --tests` with
`--message-format=json` instead; parse the output using `cargo_metadata`
to discover the location of the test binary.

Move test/integration-test/src/tests -> test/integration-test/tests to
conform to
https://doc.rust-lang.org/book/ch11-03-test-organization.html#integration-tests.
2 years ago
abhi 493a8db0ec
add libelf as a pre-requisite for linux, libbpf repo link 3 years ago
Dave Tucker 79101e748a test: Replace RTF with Rust
This commit replaces the existing RTF test runner with a simple rust
binary package called - integration-test.

integration-test depends on integration-ebpf, which contains test eBPF
code written in Rust and C. `cargo xtask build-integration-test-ebpf`
can be used to build this code and supress rust-analyzer warnings. It
does require `bpf-linker`, but that is highly likely to be available to
developers of Aya. It also requires a checkout of `libbpf` to extract
headers like bpf-helpers.h.

Since everything is compiled into a single binary, it can be run
be run locally using `cargo xtask integration-test` or remotely using
`./run.sh` which re-uses the bash script from the old test framework
to spawn a VM in which to run the tests.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker f357be7db4 aya: Support multiple maps in map sections
This commit uses the symbol table to discover all maps inside an ELF
section. Instead of doing what libbpf does - divide the section data
in to equal sized chunks - we read in to section data using the
symbol address and offset, thus allowing us to support definitions
of varying lengths.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker ce93774e0a ci: try running regression tests in a container
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
4 years ago
Dave Tucker 74ae8ce271 test: Add regression tests
This uses a mix of rust-script, bash, qemu and a test runner called RTF
to add a regression test suite... and wires it into GitHub Actions

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
4 years ago