README 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ====================
  2. Livepatch Self Tests
  3. ====================
  4. This is a small set of sanity tests for the kernel livepatching.
  5. The test suite loads and unloads several test kernel modules to verify
  6. livepatch behavior. Debug information is logged to the kernel's message
  7. buffer and parsed for expected messages. (Note: the tests will compare
  8. the message buffer for only the duration of each individual test.)
  9. Config
  10. ------
  11. Set these config options and their prerequisites:
  12. CONFIG_LIVEPATCH=y
  13. CONFIG_TEST_LIVEPATCH=m
  14. Running the tests
  15. -----------------
  16. Test kernel modules are built as part of lib/ (make modules) and need to
  17. be installed (make modules_install) as the test scripts will modprobe
  18. them.
  19. To run the livepatch selftests, from the top of the kernel source tree:
  20. % make -C tools/testing/selftests TARGETS=livepatch run_tests
  21. Adding tests
  22. ------------
  23. See the common functions.sh file for the existing collection of utility
  24. functions, most importantly setup_config(), start_test() and
  25. check_result(). The latter function greps the kernel's ring buffer for
  26. "livepatch:" and "test_klp" strings, so tests be sure to include one of
  27. those strings for result comparison. Other utility functions include
  28. general module loading and livepatch loading helpers (waiting for patch
  29. transitions, sysfs entries, etc.)