Thread (8 messages) 8 messages, 3 authors, 2019-07-24

Re: [PATCH v3] selftests/livepatch: add test skip handling

From: shuah <shuah@kernel.org>
Date: 2019-07-23 15:54:08
Also in: linux-kselftest

Hi Joe,

On 7/22/19 8:05 AM, Joe Lawrence wrote:
Add a skip() message function that stops the test, logs an explanation,
and sets the "skip" return code (4).

Before loading a livepatch self-test kernel module, first verify that
we've built and installed it by running a 'modprobe --dry-run'.  This
should catch a few environment issues, including !CONFIG_LIVEPATCH and
!CONFIG_TEST_LIVEPATCH.  In these cases, exit gracefully with the new
skip() function.

Reported-by: Jiri Benc <redacted>
Suggested-by: Shuah Khan <shuah@kernel.org>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
---

v3: tweak modprobe error message: check kernel config and run as root,
so output now looks like [shuah] :
Couple of small tweaks to user visible message below.
   % make run_tests
   TAP version 13
   1..3
   # selftests: livepatch: test-livepatch.sh
   # TEST: basic function patching ... SKIP: unable load module test_klp_livepatch, verify CONFIG_TEST_LIVEPATCH=m and run self-tests as root
   not ok 1 selftests: livepatch: test-livepatch.sh # SKIP
unable to
   # selftests: livepatch: test-callbacks.sh
   # TEST: target module before livepatch ... SKIP: unable load module test_klp_callbacks_mod, verify CONFIG_TEST_LIVEPATCH=m and run self-tests as root
unable to
   not ok 2 selftests: livepatch: test-callbacks.sh # SKIP
   # selftests: livepatch: test-shadow-vars.sh
   # TEST: basic shadow variable API ... SKIP: unable load module test_klp_shadow_vars, verify CONFIG_TEST_LIVEPATCH=m and run self-tests as root
unable to

thanks for taking care of this.

-- Shuah
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help