README.txt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Linux Kernel Selftests
  2. The kernel contains a set of "self tests" under the tools/testing/selftests/
  3. directory. These are intended to be small unit tests to exercise individual
  4. code paths in the kernel.
  5. On some systems, hot-plug tests could hang forever waiting for cpu and
  6. memory to be ready to be offlined. A special hot-plug target is created
  7. to run full range of hot-plug tests. In default mode, hot-plug tests run
  8. in safe mode with a limited scope. In limited mode, cpu-hotplug test is
  9. run on a single cpu as opposed to all hotplug capable cpus, and memory
  10. hotplug test is run on 2% of hotplug capable memory instead of 10%.
  11. Running the selftests (hotplug tests are run in limited mode)
  12. =============================================================
  13. To build the tests:
  14. $ make -C tools/testing/selftests
  15. To run the tests:
  16. $ make -C tools/testing/selftests run_tests
  17. - note that some tests will require root privileges.
  18. To run only tests targeted for a single subsystem: (including
  19. hotplug targets in limited mode)
  20. $ make -C tools/testing/selftests TARGETS=cpu-hotplug run_tests
  21. See the top-level tools/testing/selftests/Makefile for the list of all possible
  22. targets.
  23. Running the full range hotplug selftests
  24. ========================================
  25. To build the tests:
  26. $ make -C tools/testing/selftests hotplug
  27. To run the tests:
  28. $ make -C tools/testing/selftests run_hotplug
  29. - note that some tests will require root privileges.
  30. Contributing new tests
  31. ======================
  32. In general, the rules for for selftests are
  33. * Do as much as you can if you're not root;
  34. * Don't take too long;
  35. * Don't break the build on any architecture, and
  36. * Don't cause the top-level "make run_tests" to fail if your feature is
  37. unconfigured.