[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4aaa05fb405e921f25c907ca09ea29976ca0707c.camel@suse.com>
Date: Wed, 17 Jan 2024 22:52:51 -0300
From: mpdesouza@...e.com
To: Alexander Gordeev <agordeev@...ux.ibm.com>
Cc: Shuah Khan <shuah@...nel.org>, Jonathan Corbet <corbet@....net>, Heiko
Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>, Christian
Borntraeger <borntraeger@...ux.ibm.com>, Sven Schnelle
<svens@...ux.ibm.com>, Josh Poimboeuf <jpoimboe@...nel.org>, Jiri Kosina
<jikos@...nel.org>, Miroslav Benes <mbenes@...e.cz>, Petr Mladek
<pmladek@...e.com>, Joe Lawrence <joe.lawrence@...hat.com>,
linux-kselftest@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
live-patching@...r.kernel.org
Subject: Re: [PATCH v6 2/3] livepatch: Move tests from lib/livepatch to
selftests/livepatch
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!
Powered by blists - more mailing lists