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 1, 2021
1 parent 7af9797 commit b52e309
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ 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
sudo go test ./...
```

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 b52e309

Please sign in to comment.