Live Patching
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Song Liu" <song@kernel.org>, live-patching@vger.kernel.org
Cc: jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz,
	pmladek@suse.com, joe.lawrence@redhat.com, shuah@kernel.org
Subject: Re: [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches
Date: Sat, 17 Oct 2026 00:30:13 +0000	[thread overview]
Message-ID: <sashiko-outbox-175075@kernel.org> (raw)
In-Reply-To: <20261017002441.716615-5-song@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/livepatch: test-dependent-patches.sh duplicates test-basic.sh setup
--

commit fc2a73d39b4eb0e68d2bd9630878b28c5feeaab1
Author: Song Liu <song@kernel.org>

selftests/livepatch: Test klp-build with dependent patches

This commit adds a new selftest script, test-dependent-patches.sh, to test
klp-build when a second patch modifies lines added by an earlier patch.

> diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh b/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
> new file mode 100755
> index 0000000000000..75b957ac002c0
> --- /dev/null
> +++ b/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
> @@ -0,0 +1,72 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +. "$(dirname "$0")/functions.sh"
> +
> +setup_tree
> +
> +add_file drivers/foo/foo.c <<'EOT'
> +int foo(int x)
> +{
> +	if (x < 0)
> +		return -1;
> +	return x;
> +}
> +
> +int bar(void)
> +{
> +	return __LINE__;
> +}
> +EOT
> +
> +# - a patch which changes lines added by an earlier patch doesn't apply to the
> +#   original source on its own, but the combined patch does
> +
> +start_test "patch which depends on an earlier one"
> +
> +add_patch 0001-foo.patch <<'EOT'
> +--- a/drivers/foo/foo.c
> ++++ b/drivers/foo/foo.c
> +@@ -1,6 +1,8 @@
> + int foo(int x)
> + {
> ++	if (!x)
> ++		return 0;
> + 	if (x < 0)
> + 		return -1;
> + 	return x;
> + }
> +EOT

[Severity: Low]
In tools/testing/selftests/livepatch/test_klp_build/test-basic.sh, the
script already calls setup_tree, creates the identical drivers/foo/foo.c
via add_file, and defines the identical 0001-foo.patch via add_patch.

Since run_klp_build() in functions.sh leaves $TREE unmodified between
invocations and supports running multiple start_test cases sequentially in
a single script, should this dependent-patch test case be added to
test-basic.sh instead of duplicating the setup in a new standalone
test-dependent-patches.sh file?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261017002441.716615-1-song@kernel.org?part=4

  reply	other threads:[~2026-10-17  0:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17  0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
2026-10-17  0:24 ` [PATCH 01/11] klp-build: Fix dependent patches in a series Song Liu
2026-10-17  0:24 ` [PATCH 02/11] klp-build: Add --patch-only option Song Liu
2026-10-17  0:24 ` [PATCH 03/11] selftests/livepatch: Add tests for klp-build's patch handling Song Liu
2026-10-17  0:24 ` [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches Song Liu
2026-10-17  0:30   ` sashiko-bot [this message]
2026-10-17  0:24 ` [PATCH 05/11] selftests/livepatch: Test klp-build with patches to different functions Song Liu
2026-10-17  0:24 ` [PATCH 06/11] selftests/livepatch: Test klp-build with patches which cancel out Song Liu
2026-10-17  0:24 ` [PATCH 07/11] selftests/livepatch: Test klp-build with created and deleted files Song Liu
2026-10-17  0:24 ` [PATCH 08/11] selftests/livepatch: Test where klp-build adds #line directives Song Liu
2026-10-17  0:24 ` [PATCH 09/11] selftests/livepatch: Test klp-build's rejection of unsupported files Song Liu
2026-10-17  0:24 ` [PATCH 10/11] selftests/livepatch: Test klp-build with patches which don't apply Song Liu
2026-10-17  0:24 ` [PATCH 11/11] selftests/livepatch: Test klp-build with patches which need offset or fuzz Song Liu

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=sashiko-outbox-175075@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shuah@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox