Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org
Cc: jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz,
	pmladek@suse.com, joe.lawrence@redhat.com, shuah@kernel.org,
	linux-kernel@vger.kernel.org, Song Liu <song@kernel.org>
Subject: [PATCH 00/11] klp-build: Fix dependent patches, add selftests
Date: Fri, 16 Oct 2026 17:24:30 -0700	[thread overview]
Message-ID: <20261017002441.716615-1-song@kernel.org> (raw)

klp-build fails when a later patch in the series depends on an earlier
one, because it fixes each patch against the original source on its
own.  Patch 1 fixes this by combining the patches into a single patch
before adding the #line directives.

So far, testing this step has needed a full kernel build.  Patch 2 adds
a --patch-only option, which validates and fixes the patches, prints
the result, and exits without building.

Patches 3-11 use it to add a kselftest target, livepatch/test_klp_build.
Each test builds a small source tree, runs "klp-build --patch-only" on
some patches, and checks the patch it prints.  The tests compile
nothing, need no root, and take about a second.  To run them:

  make -C tools/testing/selftests/livepatch/test_klp_build tests

Song Liu (11):
  klp-build: Fix dependent patches in a series
  klp-build: Add --patch-only option
  selftests/livepatch: Add tests for klp-build's patch handling
  selftests/livepatch: Test klp-build with dependent patches
  selftests/livepatch: Test klp-build with patches to different
    functions
  selftests/livepatch: Test klp-build with patches which cancel out
  selftests/livepatch: Test klp-build with created and deleted files
  selftests/livepatch: Test where klp-build adds #line directives
  selftests/livepatch: Test klp-build's rejection of unsupported files
  selftests/livepatch: Test klp-build with patches which don't apply
  selftests/livepatch: Test klp-build with patches which need offset or
    fuzz

 scripts/livepatch/klp-build                   | 121 ++++++++----
 tools/testing/selftests/Makefile              |   1 +
 tools/testing/selftests/livepatch/README      |  16 ++
 .../livepatch/test_klp_build/Makefile         |  27 +++
 .../livepatch/test_klp_build/functions.sh     | 150 +++++++++++++++
 .../livepatch/test_klp_build/run-tests.sh     |  68 +++++++
 .../livepatch/test_klp_build/test-basic.sh    |  57 ++++++
 .../test_klp_build/test-cancelling-patches.sh | 102 ++++++++++
 .../test_klp_build/test-dependent-patches.sh  |  72 +++++++
 .../test-independent-patches.sh               | 124 +++++++++++++
 .../test_klp_build/test-line-directives.sh    | 175 ++++++++++++++++++
 .../test-new-and-deleted-files.sh             |  94 ++++++++++
 .../test_klp_build/test-offset-and-fuzz.sh    | 120 ++++++++++++
 .../test_klp_build/test-patch-not-applying.sh |  73 ++++++++
 .../test_klp_build/test-unsupported-files.sh  |  30 +++
 15 files changed, 1189 insertions(+), 41 deletions(-)
 create mode 100644 tools/testing/selftests/livepatch/test_klp_build/Makefile
 create mode 100644 tools/testing/selftests/livepatch/test_klp_build/functions.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/run-tests.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-basic.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-cancelling-patches.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-independent-patches.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-line-directives.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-new-and-deleted-files.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-offset-and-fuzz.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-patch-not-applying.sh
 create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-unsupported-files.sh

-- 
2.53.0-Meta


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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17  0:24 Song Liu [this message]
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: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=20261017002441.716615-1-song@kernel.org \
    --to=song@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=shuah@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