From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v3 1/2] selftests: pstore: skip when no backend is registered
Date: Fri, 25 Sep 2026 16:18:52 +0300 [thread overview]
Message-ID: <20260925132028.3630224-2-eva.kurchatova@virtuozzo.com> (raw)
In-Reply-To: <20260925132028.3630224-1-eva.kurchatova@virtuozzo.com>
An unregistered pstore backend reads back "(null)", and every latter
check fails. This also contradicts the pstore_crash_test documentation.
pstore_crash_test has carried the comment, but never implemented it:
# exit if pstore backend is not registered
Fix by skipping an unregistered backend in common_tests.
https://virtuozzo.atlassian.net/browse/VSTOR-142447
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
tools/testing/selftests/pstore/common_tests | 17 ++++++++++++-----
.../selftests/pstore/pstore_post_reboot_tests | 3 ---
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/pstore/common_tests b/tools/testing/selftests/pstore/common_tests
index 4509f0cc9c91..8f140fa572af 100755
--- a/tools/testing/selftests/pstore/common_tests
+++ b/tools/testing/selftests/pstore/common_tests
@@ -55,6 +55,8 @@ operate_files() { # tested value, files, operation
# Parameters
TEST_STRING_PATTERN="Testing pstore: uuid="
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
UUID=`cat /proc/sys/kernel/random/uuid`
TOP_DIR=`absdir $0`
LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`_${UUID}/
@@ -74,10 +76,15 @@ prlog "=== Pstore unit tests (`basename $0`) ==="
prlog "UUID="$UUID
prlog -n "Checking pstore backend is registered ... "
-backend=`cat /sys/module/pstore/parameters/backend`
-show_result $?
+# No file at all where pstore is not loaded, "(null)" where none registered
+backend=`cat /sys/module/pstore/parameters/backend 2>/dev/null`
+if [ -z "$backend" ] || [ "$backend" = "(null)" ]; then
+ prlog "SKIP"
+ prlog -e "\tbackend=${backend:-<none>}"
+ prlog -e "\tcmdline=`cat /proc/cmdline`"
+ prlog "pstore backend is not registered, skipping"
+ exit $ksft_skip
+fi
+prlog "ok"
prlog -e "\tbackend=${backend}"
prlog -e "\tcmdline=`cat /proc/cmdline`"
-if [ $rc -ne 0 ]; then
- exit 1
-fi
diff --git a/tools/testing/selftests/pstore/pstore_post_reboot_tests b/tools/testing/selftests/pstore/pstore_post_reboot_tests
index d6da5e86efbf..2edd48a87dda 100755
--- a/tools/testing/selftests/pstore/pstore_post_reboot_tests
+++ b/tools/testing/selftests/pstore/pstore_post_reboot_tests
@@ -7,9 +7,6 @@
# Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
#
-# Kselftest framework requirement - SKIP code is 4.
-ksft_skip=4
-
. ./common_tests
if [ -e $REBOOT_FLAG ]; then
--
2.55.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-09-25 13:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 13:18 [Devel] [PATCH hci-8.1 v3 0/2] selftests: pstore: fix backend/frontend skip Eva Kurchatova
2026-09-25 13:18 ` Eva Kurchatova [this message]
2026-09-25 13:18 ` [Devel] [PATCH hci-8.1 v3 2/2] selftests: pstore: skip the frontends the kernel does not have Eva Kurchatova
2026-09-25 14:57 ` [Devel] [PATCH hci-8.1 v3 0/2] selftests: pstore: fix backend/frontend skip Konstantin Khorenko
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=20260925132028.3630224-2-eva.kurchatova@virtuozzo.com \
--to=eva.kurchatova@virtuozzo.com \
--cc=devel@openvz.org \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.