From: Petr Mladek <pmladek@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz,
joe.lawrence@redhat.com, song@kernel.org,
live-patching@vger.kernel.org
Subject: Re: [PATCH v7 for-next 6/8] selftests/livepatch: Add provides/obsoletes test scenarios
Date: Wed, 2 Sep 2026 17:15:52 +0200 [thread overview]
Message-ID: <apg9qFCgDaXbUT6J@pathway.suse.cz> (raw)
In-Reply-To: <20260825114641.80452-7-laoar.shao@gmail.com>
On Tue 2026-08-25 19:46:39, Yafang Shao wrote:
> Now that the legacy "replace" field has been replaced by the
> provides/obsoletes mechanism, add test scenarios to verify the new
> behavior.
>
> Fill in the #else branches of the test modules that were left as
> TODO placeholders in the previous patch:
>
> - test_klp_atomic_replace.c gains provides and obsoletes module
> parameters for the provides/obsoletes based tests.
>
> - test_klp_callbacks_demo2.c gains a provides module parameter.
>
> - test_klp_livepatch.c gains a provides module parameter so that it
> can be loaded with a specific provides id for coexistence tests.
>
> - test_klp_state.c and test_klp_state2.c add a comment in the #else
> branch noting that provides=0 (the default) is equivalent to the
> previous .replace=true behavior.
>
> Add test-provides.sh with four test scenarios:
>
> 1. provides=0 replaces provides=0: two livepatches with provides=0
> that modify different functions; the second replaces the first.
>
> 2. Same provides replaces: two livepatches with provides=1 that
> modify different functions; the second replaces the first.
>
> 3. Obsoletes replaces: a livepatch with provides=2 and obsoletes=[1]
> replaces a livepatch with provides=1. The provides/obsoletes sysfs
> values are verified.
>
> 4. provides=0 coexists with provides=1: two livepatches with
> different provides ids that modify different functions coexist,
> verifying that provides=0 does not replace a patch with a
> different provides id.
>
> The provides/obsoletes based tests only run on kernels that no longer
> support the legacy "replace" attribute.
>
> Assisted-by: Comagic:DeepSeek-V4-Flash
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
> tools/testing/selftests/livepatch/Makefile | 3 +-
> .../livepatch/test-provides-obsoletes.sh | 174 ++++++++++++++++++
> .../test_modules/test_klp_atomic_replace.c | 22 ++-
> .../test_modules/test_klp_callbacks_demo2.c | 12 +-
> .../test_modules/test_klp_livepatch.c | 9 +
> .../livepatch/test_modules/test_klp_state.c | 5 +-
> .../livepatch/test_modules/test_klp_state2.c | 5 +-
> 7 files changed, 205 insertions(+), 25 deletions(-)
> create mode 100755 tools/testing/selftests/livepatch/test-provides-obsoletes.sh
>
> diff --git a/tools/testing/selftests/livepatch/Makefile b/tools/testing/selftests/livepatch/Makefile
> index a080eb54a215..38f98594d883 100644
> --- a/tools/testing/selftests/livepatch/Makefile
> +++ b/tools/testing/selftests/livepatch/Makefile
> @@ -11,7 +11,8 @@ TEST_PROGS := \
> test-ftrace.sh \
> test-sysfs.sh \
> test-syscall.sh \
> - test-kprobe.sh
> + test-kprobe.sh \
> + test-provides-obsoletes.sh
>
> TEST_FILES := settings
>
> diff --git a/tools/testing/selftests/livepatch/test-provides-obsoletes.sh b/tools/testing/selftests/livepatch/test-provides-obsoletes.sh
> new file mode 100755
> index 000000000000..2707457b9133
> --- /dev/null
> +++ b/tools/testing/selftests/livepatch/test-provides-obsoletes.sh
> @@ -0,0 +1,174 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (C) 2026 Yafang Shao <laoar.shao@gmail.com>
> +
> +. $(dirname $0)/functions.sh
> +
> +MOD_ATOMIC=test_klp_atomic_replace
> +MOD_LIVEPATCH=test_klp_livepatch
I always get lost in the various test modules and have to look
what is inside. It might help me if the name better describes
the content, for example, rename:
+ test_klp_atomic_replace -> test_klp_proc_memset_livepatch
+ test_klp_livepatch -> test_klp_proc_cmdline_livepatch
So, it is clear that they "livepatch" a given "proc" interface.
And it is rather clear that they livepatch different functions.
The names are long. The following might still be better than
the current state:
+ test_klp_memset_lp
+ test_klp_cmdline_lp
Best Regards,
Petr
next prev parent reply other threads:[~2026-09-02 15:15 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 11:46 [PATCH v7 for-next 0/8] livepatch: Introduce replace set support Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 1/8] livepatch: Make klp_find_func() non static Yafang Shao
2026-09-08 14:24 ` Miroslav Benes
2026-08-25 11:46 ` [PATCH v7 for-next 2/8] livepatch: Call klp_init_patch_early() earlier Yafang Shao
2026-08-25 12:06 ` sashiko-bot
2026-08-25 12:11 ` Yafang Shao
2026-08-27 23:57 ` Josh Poimboeuf
2026-08-28 2:24 ` Yafang Shao
2026-09-08 14:24 ` Miroslav Benes
2026-08-25 11:46 ` [PATCH v7 for-next 3/8] livepatch: Implement replace set for scoped atomic replace Yafang Shao
2026-08-25 11:59 ` sashiko-bot
2026-08-25 12:10 ` Yafang Shao
2026-08-28 0:26 ` Josh Poimboeuf
2026-08-28 3:03 ` Yafang Shao
2026-08-28 3:39 ` Josh Poimboeuf
2026-08-28 5:42 ` Yafang Shao
2026-09-02 7:31 ` Replace rules: was: " Petr Mladek
2026-09-02 9:40 ` Yafang Shao
2026-09-02 11:50 ` Yafang Shao
2026-09-03 10:01 ` Petr Mladek
2026-09-06 2:58 ` Yafang Shao
2026-09-03 9:27 ` Petr Mladek
2026-09-03 21:18 ` Song Liu
2026-09-06 8:34 ` Yafang Shao
2026-09-09 12:32 ` Miroslav Benes
2026-09-09 18:45 ` Song Liu
2026-09-10 8:31 ` Miroslav Benes
2026-09-10 9:17 ` Yafang Shao
2026-09-10 21:59 ` Song Liu
2026-09-02 7:34 ` documentation: " Petr Mladek
2026-09-02 9:50 ` Yafang Shao
2026-09-03 7:30 ` Petr Mladek
2026-09-02 7:37 ` code cleanup: " Petr Mladek
2026-09-02 9:52 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 4/8] livepatch: Deprecate stack_order Yafang Shao
2026-08-28 0:29 ` Josh Poimboeuf
2026-08-28 3:14 ` Yafang Shao
2026-09-02 12:01 ` Petr Mladek
2026-09-02 12:20 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 5/8] selftests/livepatch: Adapt atomic replace tests to provides/obsoletes Yafang Shao
2026-08-28 0:31 ` Josh Poimboeuf
2026-08-28 3:56 ` Yafang Shao
2026-09-02 13:45 ` Petr Mladek
2026-09-03 3:23 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 6/8] selftests/livepatch: Add provides/obsoletes test scenarios Yafang Shao
2026-09-02 15:15 ` Petr Mladek [this message]
2026-09-03 5:43 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 7/8] selftests/livepatch: Add test for state ID conflict across provides Yafang Shao
2026-09-02 15:25 ` Petr Mladek
2026-09-03 5:44 ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 8/8] selftests/livepatch: Add test for function " Yafang Shao
2026-09-02 15:51 ` Petr Mladek
2026-09-03 5:48 ` Yafang Shao
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=apg9qFCgDaXbUT6J@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=laoar.shao@gmail.com \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=song@kernel.org \
/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.