Tests aim to exercise the behaviour of tuners and compare baseline/test to assess performance improvements or overheads. Per-tuner tests cover the various tuners, along with general logging tests.
Tests should cover both normal and legacy mode where appropriate.
Tests operate locally using network namespaces and veth pairs to generate traffic.
Network namespace awareness requires support for netns cookies, which is not available in 5.4 kernels. In such cases, tests requiring netns cookie support are skipped automatically.
Install packages used to facilitate testing:
$ sudo dnf install iperf3 qperf proxyt kernel-uek-modules-extra clang llvm bpftool libbpf-devel libcap-devel
$ sudo dnf module install container-tools:ol8
iperf3, qperf are needed for perf testing; kernel-uek-modules-extra is needed for sch-netem; proxyt is used by podman to connect to the container registry; may not be needed depending on the network connectivity/podman config used. If podman is not installed or registry reachable, tests will be skipped.
The latter 5 packages are needed to build the sample tuner.
podman is optional and is used to verify container support in bpftune.
Package names may differ for different distros.
Ensure "bpftune -S" shows right support level (none/legacy/full) for system, and shows if per-netns policy is supported (via netns cookie).
Verify logging works with syslog, stdout/stderr.
Verify enabling/disabling bpftune via service works and bpftune is running/logging.
Ensure capabilities are dropped after initialization using getpcaps(8).
Verify that removing or adding a tuner is noticed and the tuner is cleaned up/initialized appropriately.
We provide a bare-bones sample tuner in sample_tuner/ ; it is an example of a user-provided tuner that is built using bpftune-devel and is installed in /usr/local/lib64/bpftune. The test verifies that
- installing it after bpftune has started triggers inotify events to load the tuner
- events are successfully triggered for the tuner once loaded
- it is unloaded on remove from the directory
Verify that calling sysctl with a tuner-managed value switches off the tuner in question (getting out of the way of the admin). Also verify that when a tunable is modified in a network namespace, only the network namespace tuning is switched off.
Ensure that the neigh table tuner notices the ARP/IPv6 neighbour table filling up and expands it via netlink request.
With artificially low memory pressure value, generate traffic and ensure mem pressure (tcp_mem[1]) is bumped up.
With artificially low memory exhaustion value, generate traffic and ensure mem exhaustion value (tcp_mem[2]) is bumped up.
check rmem max is increased when limit reached for receive buffer size for global and non-global netns (where netns support is present). Use an artifically low max to trigger bpftune tuning.
check wmem max is increased when limit reached for send buffer size for global and non-global netns (where netns support is present). Use an artificially low max to trigger buftune tuning.
Use tc to generate lossy connection and ensure that BBR is used as congestion control algorithm when loss rate exceeds 1%.
Measure baseline versus test (bpftune running) throughput.
Measure baseline versus test (bpftune running) throughput/latency.
Measure baseline versus test for package download.
Measure baseline versus test for large file download.