[Devel] [PATCH RHEL10 COMMIT] selftests: net: skip test_blackhole_dev if kernel module is unavailable

Konstantin Khorenko khorenko at virtuozzo.com
Thu Dec 25 14:32:32 MSK 2025


The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.28.vz10
------>
commit 15728703e95f5b5e5c3f10bc0d2534b950810706
Author: Aleksei Oladko <aleksey.oladko at virtuozzo.com>
Date:   Tue Dec 23 22:22:48 2025 +0000

    selftests: net: skip test_blackhole_dev if kernel module is unavailable
    
    The test_blackhole_dev.sh kselftest relies on the test_blackhole_dev
    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_blackhole_dev
    module and skip the test when the module is missing.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-120995
    
    Signed-off-by: Aleksei Oladko <aleksey.oladko at virtuozzo.com>
    Reviewed-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    
    Feature: fix selftests
---
 tools/testing/selftests/net/test_blackhole_dev.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/test_blackhole_dev.sh b/tools/testing/selftests/net/test_blackhole_dev.sh
index 3119b80e711fd..bb480eb1eff10 100755
--- a/tools/testing/selftests/net/test_blackhole_dev.sh
+++ b/tools/testing/selftests/net/test_blackhole_dev.sh
@@ -1,7 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 # Runs blackhole-dev test using blackhole-dev kernel module
 
+source lib.sh
+modinfo test_blackhole_dev || exit $ksft_skip
+
 if /sbin/modprobe -q test_blackhole_dev ; then
 	/sbin/modprobe -q -r test_blackhole_dev;
 	echo "test_blackhole_dev: ok";


More information about the Devel mailing list