[Devel] [PATCH vz10 4/4] selftests: net: skip test_bpf if kernel module is unavailable

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jan 9 18:47:29 MSK 2026


Same here:

So you state that those modules were not loaded automatically and the test must preload them.
At the same time those modules are loaded automatically in VHP env.

So what is the difference? Why in HCI 7.3 modules were not loaded automatically?
We definitely need to understand this because that might cause issues with other userspace in case 
modules are not being loaded automatically due to some reason.

+ why it's correct to skip the test in case the module fails to be loaded?

On 1/4/26 02:50, Aleksei Oladko wrote:
> The test_bpf.sh kselftest relies on the test_bpf kernel module to be
> present and loadable. If the module in not built or not available on
> the system, modprobe fails and the test is reported as a failure.
> 
> Add an explicit check for the availability of the test_bpf module
> and skip the test when the module is missing.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-121804
> 
> Signed-off-by: Aleksei Oladko <aleksey.oladko at virtuozzo.com>
> ---
>   tools/testing/selftests/net/test_bpf.sh | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/test_bpf.sh b/tools/testing/selftests/net/test_bpf.sh
> index 65677909c574..cfa9d676123c 100755
> --- a/tools/testing/selftests/net/test_bpf.sh
> +++ b/tools/testing/selftests/net/test_bpf.sh
> @@ -1,7 +1,10 @@
> -#!/bin/sh
> +#!/bin/bash
>   # SPDX-License-Identifier: GPL-2.0
>   # Runs bpf test using test_bpf kernel module
>   
> +source lib.sh
> +modinfo test_bpf || exit $ksft_skip
> +
>   if /sbin/modprobe -q test_bpf ; then
>   	/sbin/modprobe -q -r test_bpf;
>   	echo "test_bpf: ok";



More information about the Devel mailing list