Skip to content

Commit

Permalink
docs: add testing instructions to CONTRIBUTING.md
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Gögge <r.goegge@outlook.com>
  • Loading branch information
rgo3 committed Jun 4, 2021
1 parent 7af9797 commit c2aac01
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ reason about the proposed changes.
## Running the tests

Many of the tests require privileges to set resource limits and load eBPF code.
The easiest way to obtain these is to run the tests with `sudo`:
The easiest way to obtain these is to run the tests with `sudo`.

To test the current package with your local kernel you can simply run:
```bash
go test -exec sudo ./...
```

To test the current package with a different kernel version you can use the [run-tests.sh](run-tests.sh) script.
It requires [virtme](https://github.com/amluto/virtme) and qemu to be installed.

Examples:

```bash
$ # Run all tests on a 5.4 kernel
$ ./run-tests.sh 5.4
$
$ # Run a subset of tests:
$ ./run-tests.sh 5.4 go test ./link
```

sudo go test ./...

0 comments on commit c2aac01

Please sign in to comment.