The aya integration test suite is a set of tests to ensure that common usage behaviours work on real Linux distros
To run locally all you need is:
libelf
cargo install bpf-linker
bpftool
rustup target add x86_64-unknown-linux-musl
cargo install bpf-linker
qemu
and cloud-init-utils
package - or any package that provides cloud-localds
From the root of this repository:
cargo xtask integration-test --libbpf-dir /path/to/libbpf
./test/run.sh /path/to/libbpf
Tests should follow these guidelines:
integration-ebpf/${NAME}.rs
and included in integration-ebpf/Cargo.toml
integration-test/src/bpf/${NAME}.bpf.c
. It's automatically compiled and made available as ${OUT_DIR}/${NAME}.bpf.o
.include_bytes_aligned!
integration-test/src/test
#[integration_test]
macro to be included in the buildanyhow::Result<()>
since this allows the use of ?
to return errors.panic!
when an assertion fails or bail!
. The former is preferred since the stack trace will point directly to the failed line.