You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aya/test
Dave Tucker f12c0269d0 bpf: Maps live in maps section
This forces all maps to the maps section so we remain compatible with
libbpf. This requires #181 to avoid breaking userspace.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
..
cases bpf: Maps live in maps section 2 years ago
.gitignore test: Add regression tests 3 years ago
README.md aya: Support multiple maps in map sections 2 years ago

README.md

Aya Regression Tests

The aya regression test suite is a set of tests to ensure that common usage behaviours work on real Linux distros

Prerequisites

This assumes you have a working Rust and Go toolchain on the host machine

  1. rustup target add x86_64-unknown-linux-musl
  2. Install rtf: go install github.com/linuxkit/rtf@latest
  3. Install rust-script: cargo install rust-script
  4. Install qemu and cloud-init-utils package - or any package that provides cloud-localds

It is not required, but the tests run significantly faster if you use sccache

You may also use the docker image to run the tests:

docker run -it --rm --device /dev/kvm -v/home/dave/dev/aya-rs/aya:/src -w /src/test ghcr.io/aya-rs/aya-test-rtf:main

Usage

To read more about how to use rtf, see the documentation

Run the tests with verbose output

rtf -vvv run

Run the tests using an older kernel

AYA_TEST_IMAGE=centos8 rtf -vvv run

Writing a test

Tests should follow this pattern:

  • The eBPF code should be in a file named ${NAME}.ebpf.rs
  • The userspace code should be in a file named ${NAME}.rs
  • The userspace program should make assertions and exit with a non-zero return code to signal failure
  • VM start and stop is handled by the framework
  • Any files copied to the VM should be cleaned up afterwards

See ./cases for examples