• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Linux Test Project
2==================
3
4Linux Test Project is a joint project started by SGI, OSDL and Bull developed
5and maintained by IBM, Cisco, Fujitsu, SUSE, Red Hat, Oracle and others. The
6project goal is to deliver tests to the open source community that validate the
7reliability, robustness, and stability of Linux.
8
9The LTP testsuite contains a collection of tools for testing the Linux kernel
10and related features. Our goal is to improve the Linux kernel and system
11libraries by bringing test automation to the testing effort. Interested open
12source contributors are encouraged to join.
13
14Project pages are located at: http://linux-test-project.github.io/
15
16The latest image is always available at:
17https://github.com/linux-test-project/ltp/releases
18
19The discussion about the project happens at ltp mailing list:
20http://lists.linux.it/listinfo/ltp
21
22The git repository is located at GitHub at:
23https://github.com/linux-test-project/ltp
24
25Warning!
26========
27
28**Be careful with these tests!**
29
30Don't run them on production systems. Growfiles, doio, and iogen in particular
31stress the I/O capabilities of systems and while they should not cause problems
32on properly functioning systems, they are intended to find (or cause) problems.
33
34Quick guide to running the tests
35================================
36
37If you have git, autoconf, automake, m4, the linux headers and the common
38developer packages installed, the chances are the following will work.
39
40```
41$ git clone https://github.com/linux-test-project/ltp.git
42$ cd ltp
43$ make autotools
44$ ./configure
45$ make
46$ make install
47```
48
49This will install LTP to `/opt/ltp`.
50* If you have a problem see `doc/mini-howto-building-ltp-from-git.txt`.
51* If you still have a problem see `INSTALL` and `./configure --help`.
52* Failing that, ask for help on the mailing list or Github.
53
54Some tests will be disabled if the configure script can not find their build
55dependencies.
56
57* If a test returns `TCONF` due to a missing component, check the `./configure`
58  output.
59* If a tests fails due to a missing user or group, see the Quick Start section
60  of `INSTALL`.
61
62To run all the test suites
63
64```
65$ cd /opt/ltp
66$ ./runltp
67```
68
69Note that many test cases have to be executed as root.
70
71To run a particular test suite
72
73```
74$ ./runltp -f syscalls
75```
76
77To run all tests with `madvise` in the name
78
79```
80$ ./runltp -f syscalls -s madvise
81```
82Also see
83
84```
85$ ./runltp --help
86```
87
88Test suites (e.g. syscalls) are defined in the runtest directory. Each file
89contains a list of test cases in a simple format, see doc/ltp-run-files.txt.
90
91Each test case has its own executable or script, these can be executed
92directly
93
94```
95$ testcases/bin/abort01
96```
97
98Some have arguments
99
100```
101$ testcases/bin/fork13 -i 37
102```
103
104The vast majority of test cases accept the -h (help) switch
105
106```
107$ testcases/bin/ioctl01 -h
108```
109
110Many require certain environment variables to be set
111
112```
113$ LTPROOT=/opt/ltp PATH="$PATH:$LTPROOT/testcases/bin" testcases/bin/wc01.sh
114```
115
116Most commonly, the path variable needs to be set and also `LTPROOT`, but there
117are a number of other variables, `runltp` usually sets these for you.
118
119Note that all shell scripts need the `PATH` to be set. However this is not
120limited to shell scripts, many C based tests need environment variables as
121well.
122
123Developers corner
124=================
125
126Before you start you should read following documents:
127
128* `doc/test-writing-guidelines.txt`
129* `doc/build-system-guide.txt`
130
131There is also a step-by-step tutorial:
132
133* `doc/c-test-tutorial-simple.txt`
134
135If something is not covered there don't hesitate to ask on the LTP mailing
136list. Also note that these documents are available online at:
137
138https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines
139https://github.com/linux-test-project/ltp/wiki/BuildSystem
140https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial
141