net/route: enforce hoplimit max value
[linux-2.6-block.git] / Documentation / kselftest.txt
CommitLineData
80d03428
JK
1Linux Kernel Selftests
2
3The kernel contains a set of "self tests" under the tools/testing/selftests/
4directory. These are intended to be small unit tests to exercise individual
5code paths in the kernel.
6
ddddda9b
SK
7On some systems, hot-plug tests could hang forever waiting for cpu and
8memory to be ready to be offlined. A special hot-plug target is created
9to run full range of hot-plug tests. In default mode, hot-plug tests run
10in safe mode with a limited scope. In limited mode, cpu-hotplug test is
11run on a single cpu as opposed to all hotplug capable cpus, and memory
12hotplug test is run on 2% of hotplug capable memory instead of 10%.
13
14Running the selftests (hotplug tests are run in limited mode)
15=============================================================
80d03428
JK
16
17To build the tests:
80d03428
JK
18 $ make -C tools/testing/selftests
19
20
21To run the tests:
80d03428
JK
22 $ make -C tools/testing/selftests run_tests
23
3c415707
TB
24To build and run the tests with a single command, use:
25 $ make kselftest
26
80d03428
JK
27- note that some tests will require root privileges.
28
80d03428 29
3c415707
TB
30Running a subset of selftests
31========================================
32You can use the "TARGETS" variable on the make command line to specify
33single test to run, or a list of tests to run.
34
35To run only tests targeted for a single subsystem:
36 $ make -C tools/testing/selftests TARGETS=ptrace run_tests
37
38You can specify multiple tests to build and run:
39 $ make TARGETS="size timers" kselftest
40
41See the top-level tools/testing/selftests/Makefile for the list of all
42possible targets.
80d03428 43
80d03428 44
ddddda9b
SK
45Running the full range hotplug selftests
46========================================
47
3c415707 48To build the hotplug tests:
ddddda9b
SK
49 $ make -C tools/testing/selftests hotplug
50
3c415707 51To run the hotplug tests:
ddddda9b
SK
52 $ make -C tools/testing/selftests run_hotplug
53
54- note that some tests will require root privileges.
80d03428 55
3c415707 56
76caa6ca
WL
57Install selftests
58=================
59
60You can use kselftest_install.sh tool installs selftests in default
61location which is tools/testing/selftests/kselftest or an user specified
62location.
63
64To install selftests in default location:
65 $ cd tools/testing/selftests
66 $ ./kselftest_install.sh
67
68To install selftests in an user specified location:
69 $ cd tools/testing/selftests
70 $ ./kselftest_install.sh install_dir
71
72
80d03428
JK
73Contributing new tests
74======================
75
4db1fa66 76In general, the rules for selftests are
80d03428
JK
77
78 * Do as much as you can if you're not root;
79
80 * Don't take too long;
81
82 * Don't break the build on any architecture, and
83
84 * Don't cause the top-level "make run_tests" to fail if your feature is
85 unconfigured.