mirror of
https://github.com/containers/netavark.git
synced 2026-02-05 15:45:47 +01:00
Use this to replace ncat. ncat is flaky and harder to use and with the latest version it seems they broke us in a way that makes the flags we use incompatible[1]. As a nice benefit this makes the test code itself simpler and faster as we get rid of the is port bound polling/sleeps. [1] https://github.com/containers/netavark/pull/1282 Fixes: #1076 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Netavark integration test with bats
Running tests
To run the tests locally in your sandbox, you can use one of these methods:
- bats ./test/001-basic.bats # runs just the specified test
- bats ./test/ # runs all
The tests need root privileges to create network namespaces, so you either have to run the test as root or in a user namespace. Because the tests use iptables you also need write access to /run/xtables.lock. You can use podman unshare --rootless-netns bats test/ to run the tests as rootless user.
Requirements
- jq
- iproute2
- iptables
- firewalld
- dbus-daemon