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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jbenc@xxxxxxxxxx>
Suggested-by: Shuah Khan <shuah@xxxxxxxxxx>
Signed-off-by: Joe Lawrence <joe.lawrence@xxxxxxxxxx>
---

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



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux