Re: [ANN] Containers to run Netdev CI tests locally
From: Ilya Maximets <i.maximets@ovn.org>
Date: 2026-09-04 15:25:55
On 9/4/26 4:54 PM, Matthieu Baerts wrote:
Hi Ilya, Thank you for your reply! On 04/09/2026 16:01, Ilya Maximets wrote:quoted
On 9/3/26 6:19 PM, Matthieu Baerts wrote:quoted
A wiki page has been added to cover this and explain how to validate the different tests: https://github.com/linux-netdev/nipa/wiki/Running-Netdev-CI-tests-locally To help developers, containers are now built, packing all the required dependencies to run these tests in order to run the tests in an environment that would be as close as possible to the CI one. The goal is to have an environment that is easy to maintain -- no heavy optimisations to reduce the images size -- but also easy to use. In short, people (and non-humans) can continue to use the different tools as before, but add a prefix to the different commands to execute them from a container, e.g. alias run="${nipa}/docker/selftests/run.sh" run vng --build run make headers (...)The headers are not used unless the USERCFLAGS="-I$(pwd)/usr/include" is passed into the actual make command for the selftests. So, uAPI changes will not be picked up. Would be good to fix that in the wiki.I think setting USERCFLAGS is not supposed to be required for this purpose: KHDR_INCLUDES is there for that. According to the doc [1], each target building binaries should have "CFLAGS = $(KHDR_INCLUDES)" in their Makefile. If KHDR_INCLUDES is not set by the user, then lib.mk will set it to "-I$(top_srcdir)/usr/include", so the default directory when "make headers" is used. It needs to be adapted with building in a different directory. At least, when validating all net and drv-net selftests on my side, I didn't need to specify extra CFLAGS. (I think the netfilter target is missing KHDR_INCLUDES, I will fix that.) Or did you have to do that for a specific target?
I was actually having trouble with the netfilter target specifically as I'm working on a patch that changes uAPI and the selftest build can't pick it up without the USERCFLAGS. But if it's actually a bug in the makefile for that target, then it's better to fix this target, of course, instead of changing the docs. :) Thanks for taking a look!
Just in case, here are the recommended commands to execute to run the selftests per target: alias run="${nipa}/docker/selftests/run.sh" rm -f .config config="tools/testing/selftests/${target}/config" run vng --build -v --force --config "${config}" ## + debug run make headers run make -C tools/testing/selftests TARGETS="${target}" run sudo vng -v --run . --user root -a mitigations=off --cpus 4 \ --rw --network loop -- \ make -C tools/testing/selftests TARGETS="${target}" run_testsquoted
The $(pwd) part is a little tricky since it will be resolved outside of the container. I didn't try if that works.Note that in the container, the current directory is mounted at the same place. So $(pwd) can be used. [1] https://docs.kernel.org/dev-tools/kselftest.html#contributing-new-tests-details Cheers, Matt