OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: [Devel] [PATCH RHEL10 COMMIT] selftests/gpio: skip when gpio-mockup module is unavailable
Date: Tue, 18 Aug 2026 20:08:13 +0200	[thread overview]
Message-ID: <202608181808.67II8DEk402385@f0.sw.ru> (raw)
In-Reply-To: <20260818180715.402282-1-khorenko@virtuozzo.com>

The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.6.vz10
------>
commit 47c064bd2e73732eb86ad6587b4592b54cc8c654
Author: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Date:   Tue Aug 18 20:00:54 2026 +0200

    selftests/gpio: skip when gpio-mockup module is unavailable
    
    The gpio-mockup test begins with:
    
        remove_module || fail "can't remove existing $module module"
    
    where remove_module is simply 'modprobe -r -q gpio-mockup'. On a kernel
    built without CONFIG_GPIO_MOCKUP (which is the case for many distro
    kernels, including RHEL10 and ours), the module file does not exist,
    modprobe -r returns non-zero, and the test is reported as FAIL even
    though there is nothing for it to test.
    
    Note that 'modprobe -r -q' returns 0 for a module which exists but is
    not loaded, so it is only the completely absent module which trips this
    up. Detect that in prerequisite() and skip cleanly, the way
    selftests/mm/test_hmm.sh, selftests/mm/test_vmalloc.sh and
    selftests/fpu/run_test_fpu.sh already do.
    
    After this:
    
        # GPIO gpio-mockup test SKIP
        ok 1 selftests: gpio: gpio-mockup.sh # SKIP
    
    instead of:
    
        not ok 1 selftests: gpio: gpio-mockup.sh # exit=1
    
    https://virtuozzo.atlassian.net/browse/VSTOR-134202
    Feature: fix selftests
    Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 tools/testing/selftests/gpio/gpio-mockup.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/gpio/gpio-mockup.sh b/tools/testing/selftests/gpio/gpio-mockup.sh
index fc2dd4c24d069..e6c236018c42a 100755
--- a/tools/testing/selftests/gpio/gpio-mockup.sh
+++ b/tools/testing/selftests/gpio/gpio-mockup.sh
@@ -51,6 +51,8 @@ prerequisite()
 	DEBUGFS=$(grep -w debugfs /proc/mounts | cut -f2 -d' ')
 	[ -d "$DEBUGFS" ] || skip "debugfs is not mounted"
 
+	modinfo $module >/dev/null 2>&1 || skip "$module module is not available"
+
 	GPIO_DEBUGFS=$DEBUGFS/$module
 }
 

      reply	other threads:[~2026-08-18 18:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260625175159.1541911-1-eva.kurchatova@virtuozzo.com>
2026-08-18 18:07 ` [Devel] [PATCH vz10 v2] " Konstantin Khorenko
2026-08-18 18:08   ` Konstantin Khorenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202608181808.67II8DEk402385@f0.sw.ru \
    --to=khorenko@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox