Back to home page

OSCL-LXR

 
 

    


0001 ====================
0002 Livepatch Self Tests
0003 ====================
0004 
0005 This is a small set of sanity tests for the kernel livepatching.
0006 
0007 The test suite loads and unloads several test kernel modules to verify
0008 livepatch behavior.  Debug information is logged to the kernel's message
0009 buffer and parsed for expected messages.  (Note: the tests will compare
0010 the message buffer for only the duration of each individual test.)
0011 
0012 
0013 Config
0014 ------
0015 
0016 Set these config options and their prerequisites:
0017 
0018 CONFIG_LIVEPATCH=y
0019 CONFIG_TEST_LIVEPATCH=m
0020 
0021 
0022 Running the tests
0023 -----------------
0024 
0025 Test kernel modules are built as part of lib/ (make modules) and need to
0026 be installed (make modules_install) as the test scripts will modprobe
0027 them.
0028 
0029 To run the livepatch selftests, from the top of the kernel source tree:
0030 
0031   % make -C tools/testing/selftests TARGETS=livepatch run_tests
0032 
0033 
0034 Adding tests
0035 ------------
0036 
0037 See the common functions.sh file for the existing collection of utility
0038 functions, most importantly setup_config(), start_test() and
0039 check_result().  The latter function greps the kernel's ring buffer for
0040 "livepatch:" and "test_klp" strings, so tests be sure to include one of
0041 those strings for result comparison.  Other utility functions include
0042 general module loading and livepatch loading helpers (waiting for patch
0043 transitions, sysfs entries, etc.)