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 ce93774e0a ci: try running regression tests in a container
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
..
cases test: Add a check for minimum kernel version 3 years ago
.gitignore test: Add regression tests 3 years ago
README.md ci: try running regression tests in a container 3 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 toolchain 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