Commit Graph

16 Commits

Author SHA1 Message Date
Tamir Duberstein
a9945b0957 xtask: implement unit tests in VM
This is quite useful when developing on macOS.
2025-12-31 05:01:43 -05:00
Tamir Duberstein
d1457acc6d ci: cache downloads
We're seeing 429 from Github trying to download gen_init_cpio, so cache
it using actions cache. Since I'm here add this for kernel images as
well to save time waiting on slow Debian servers.
2024-12-23 06:43:18 +01:00
lyuts
34ffde48ee tests: update instructions on setting up and running tests
- Update the list of required packages.
- Update the command for executing tests in a VM.
2023-11-20 15:33:48 +11:00
Dave Tucker
8780a50be1 .github: Add markdownlint
This adds a linter to catch common markdown formatting errors.
The linter used is markdownlint-cli2 which is available on all platforms
and has an associated Github Action to automate these checks in CI.

Configuration is checked in at .markdownlint-cli2.yaml.

You may run the check locally using `markdownlint-cli2`.
Or you may install the extension for VSCode:
DavidAnson.vscode-markdownlint

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2023-11-16 16:14:05 -05:00
Tamir Duberstein
82a77bc83d integration-test: Implement running on VMs
Implements running integration tests on multiple VMs with arbitrary
kernel images using `cargo xtask integration-test vm ...`.

This changes our coverage from 6.2 to 6.1 and 6.4.
2023-08-09 15:39:55 -04:00
Tamir Duberstein
30faa5f68f Add links iterator
This is not yet exposed in documentation, but is complete enough for use
in tests, removing the dependency on bpftool.

Updates #645.
2023-08-01 20:36:08 -04:00
Tamir Duberstein
dca5e6c167 integration-test: Remove runtime toolchain deps
Move the use of clang and llvm-objcopy from run-time to build-time. This
allows the integration tests to run on VMs with simpler userlands.

Create a new CI job to build the integration tests separately from
running them. Ship them from that job to the runner job using github
actions artifacts.
2023-08-01 12:28:41 -04:00
Andrew Werner
af747f8caa test: update README.md
A checkout of libbpf is no longer required.
2023-07-18 11:50:26 -04:00
Tamir Duberstein
3d463a3610 integration-test: compile Rust probes using build.rs 2023-07-12 21:43:26 -04:00
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.
2023-07-12 21:43:24 -04:00
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.
2023-07-07 16:48:12 -04:00
abhi
493a8db0ec add libelf as a pre-requisite for linux, libbpf repo link 2022-10-09 23:47:49 +05:30
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>
2022-07-03 14:33:24 +01:00
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>
2022-04-29 22:14:48 +01:00
Dave Tucker
ce93774e0a ci: try running regression tests in a container
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2022-01-22 12:49:10 +00:00
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>
2022-01-19 16:52:31 +00:00