public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: mpdesouza@suse.com
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Shuah Khan <shuah@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
	 Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	linux-kselftest@vger.kernel.org,  linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,  linux-s390@vger.kernel.org,
	live-patching@vger.kernel.org
Subject: Re: [PATCH v6 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch
Date: Wed, 17 Jan 2024 22:52:51 -0300	[thread overview]
Message-ID: <4aaa05fb405e921f25c907ca09ea29976ca0707c.camel@suse.com> (raw)
In-Reply-To: <Zaf08hx8fBj6TW5/@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>

On Wed, 2024-01-17 at 16:40 +0100, Alexander Gordeev wrote:
> On Fri, Jan 12, 2024 at 02:43:51PM -0300, Marcos Paulo de Souza
> wrote:
> 
> Hi Marcos!

Hello!

> 
> > Having the modules being built as out-of-modules requires changing
> > the
> > currently used 'modprobe' by 'insmod' and adapt the test scripts
> > that
> > check for the kernel message buffer.
> 
> Please, correct me if I am wrong, but with this change one would
> require a configured build environment and kernel tree that matches
> running kernel in order to run tests. Is that correct?

You don't need a kernel tree in order to run the tests, you can build
the modules and use gen_tar to pack them, setting KDIR to the currently
built kernel:
		make KDIR=$(pwd) TARGETS=livepatch -C
tools/testing/selftests

This can be used when packaging the tests, like Joe showed when
reviewing the v4:

	mkdir /tmp/test-install
	make KDIR=$(pwd) INSTALL_PATH=/tmp/test-install
TARGETS=livepatch -C tools/testing/selftests install

In this case /tmp/test-install will contain the scripts and the modules
compiled targeting the same kernel version from the kernel built from
the kernel tree.

You can also run the tests from the kernel tree but targeting your
currently running system.
Using this approach you can run the tests on machines without kernel
tree and without build environment.

You can also pick the kernel source and run
	make kselftest TARGETS=livepatch

As KDIR wasn't set it builds the livepatch test modules targeting
/lib/modules/<current kernel version/build, and so you can run the
tests against your currently running kernel. This would require kernel-
devel package and gcc.

I hope this answer your question, and provides some info about how to
run the tests on different environments!

Thanks,
  Marcos

> 
> Thanks!


  reply	other threads:[~2024-01-18  1:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 17:43 [PATCH v6 0/3] livepatch: Move modules to selftests and add a new test Marcos Paulo de Souza
2024-01-12 17:43 ` [PATCH v6 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable Marcos Paulo de Souza
2024-01-22 17:15   ` Shuah Khan
2024-01-22 17:37     ` Marcos Paulo de Souza
2024-01-22 17:38       ` Shuah Khan
2024-01-12 17:43 ` [PATCH v6 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch Marcos Paulo de Souza
2024-01-17 15:40   ` Alexander Gordeev
2024-01-18  1:52     ` mpdesouza [this message]
2024-01-19 13:10   ` Alexander Gordeev
2024-01-19 13:19     ` Alexander Gordeev
2024-01-22 12:55       ` Marcos Paulo de Souza
2024-01-22 17:22         ` Shuah Khan
2024-01-12 17:43 ` [PATCH v6 3/3] selftests: livepatch: Test livepatching a heavily called syscall Marcos Paulo de Souza
2024-01-17 20:52 ` [PATCH v6 0/3] livepatch: Move modules to selftests and add a new test Joe Lawrence

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=4aaa05fb405e921f25c907ca09ea29976ca0707c.camel@suse.com \
    --to=mpdesouza@suse.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=corbet@lwn.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=shuah@kernel.org \
    --cc=svens@linux.ibm.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