• Home
Name Date Size #Lines LOC

..--

.github/06-Sep-2024-244185

android/06-Sep-2024-9,6208,349

ci/06-Sep-2024-379278

doc/06-Sep-2024-8,6806,574

docparse/06-Sep-2024-848657

include/06-Sep-2024-25,24717,204

lib/06-Sep-2024-27,99519,470

libs/06-Sep-2024-1,7451,175

m4/06-Sep-2024-963809

metadata/06-Sep-2024-1,5241,195

pan/06-Sep-2024-3,1702,248

runtest/06-Sep-2024-5,0084,335

scenario_groups/06-Sep-2024-12490

scripts/06-Sep-2024-10,3138,305

testcases/06-Sep-2024-761,690491,394

testscripts/06-Sep-2024-994734

tools/06-Sep-2024-3,4642,442

utils/06-Sep-2024-13,1247,886

.dockerignoreD06-Sep-202414 21

.gitignoreD06-Sep-2024660 6658

.mailmapD06-Sep-2024112 32

Android.bpD06-Sep-20245.8 KiB189172

COPYINGD06-Sep-202417.7 KiB340281

ContainerfileD06-Sep-2024793 3627

IDcheck.shD06-Sep-20245 KiB197136

INSTALLD06-Sep-20248.7 KiB249181

LICENSED06-Sep-202417.7 KiB340281

METADATAD06-Sep-2024341 87

MODULE_LICENSE_GPLD06-Sep-20240

MakefileD06-Sep-20246.8 KiB225135

NOTICED06-Sep-202417.7 KiB340281

OWNERSD06-Sep-202476 54

README.mdD06-Sep-20247.2 KiB252181

TEST_MAPPINGD06-Sep-202413.5 KiB578577

TODOD06-Sep-20241.3 KiB4026

VERSIOND06-Sep-20249 21

build.shD06-Sep-20245.8 KiB252202

configure.acD06-Sep-202412.1 KiB464409

gen.bpD06-Sep-2024696.9 KiB26,73824,054

ltpmenuD06-Sep-202419 KiB549321

runltpD06-Sep-202435.3 KiB947737

ver_linuxD06-Sep-20243.9 KiB176126

README.md

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
22LTP mailing list is archived at:
23https://lore.kernel.org/ltp/
24
25IRC #ltp at: [irc.libera.chat](https://libera.chat/)
26
27The git repository is located at GitHub at:
28https://github.com/linux-test-project/ltp
29
30The patchwork instance is at:
31https://patchwork.ozlabs.org/project/ltp/list/
32
33Warning!
34========
35
36**Be careful with these tests!**
37
38Don't run them on production systems. Growfiles, doio, and iogen in particular
39stress the I/O capabilities of systems and while they should not cause problems
40on properly functioning systems, they are intended to find (or cause) problems.
41
42Quick guide to running the tests
43================================
44
45If you have git, autoconf, automake, m4, pkgconf / pkg-config, libc headers,
46linux kernel headers and other common development packages installed (see
47INSTALL and ci/*.sh), the chances are the following will work:
48
49```
50$ git clone https://github.com/linux-test-project/ltp.git
51$ cd ltp
52$ make autotools
53$ ./configure
54```
55
56Now you can continue either with compiling and running a single test or with
57compiling and installing the whole testsuite.
58
59For optional library dependencies look into scripts for major distros in
60`ci/` directory. You can also build whole LTP with `./build.sh` script.
61
62Shortcut to running a single test
63---------------------------------
64If you need to execute a single test you actually do not need to compile
65the whole LTP, if you want to run a syscall testcase following should work.
66
67```
68$ cd testcases/kernel/syscalls/foo
69$ make
70$ PATH=$PATH:$PWD ./foo01
71```
72
73Shell testcases are a bit more complicated since these need a path to a shell
74library as well as to compiled binary helpers, but generally following should
75work.
76
77```
78$ cd testcases/lib
79$ make
80$ cd ../commands/foo
81$ PATH=$PATH:$PWD:$PWD/../../lib/ ./foo01.sh
82```
83
84Open Posix Testsuite has it's own build system which needs Makefiles to be
85generated first, then compilation should work in subdirectories as well.
86
87```
88$ cd testcases/open_posix_testsuite/
89$ make generate-makefiles
90$ cd conformance/interfaces/foo
91$ make
92$ ./foo_1-1.run-test
93```
94
95Compiling and installing all testcases
96--------------------------------------
97
98```
99$ make
100$ make install
101```
102
103This will install LTP to `/opt/ltp`.
104* If you have a problem see `INSTALL` and `./configure --help`.
105* Failing that, ask for help on the mailing list or Github.
106
107Some tests will be disabled if the configure script can not find their build
108dependencies.
109
110* If a test returns `TCONF` due to a missing component, check the `./configure`
111  output.
112* If a tests fails due to a missing user or group, see the Quick Start section
113  of `INSTALL`.
114
115Running tests
116-------------
117
118To run all the test suites
119
120```
121$ cd /opt/ltp
122$ ./runltp
123```
124
125Note that many test cases have to be executed as root.
126
127To run a particular test suite
128
129```
130$ ./runltp -f syscalls
131```
132
133To run all tests with `madvise` in the name
134
135```
136$ ./runltp -f syscalls -s madvise
137```
138Also see
139
140```
141$ ./runltp --help
142```
143
144Test suites (e.g. syscalls) are defined in the runtest directory. Each file
145contains a list of test cases in a simple format, see doc/ltp-run-files.txt.
146
147Each test case has its own executable or script, these can be executed
148directly
149
150```
151$ testcases/bin/abort01
152```
153
154Some have arguments
155
156```
157$ testcases/bin/mesgq_nstest -m none
158```
159
160The vast majority of test cases accept the -h (help) switch
161
162```
163$ testcases/bin/ioctl01 -h
164```
165
166Many require certain environment variables to be set
167
168```
169$ LTPROOT=/opt/ltp PATH="$PATH:$LTPROOT/testcases/bin" testcases/bin/wc01.sh
170```
171
172Most commonly, the path variable needs to be set and also `LTPROOT`, but there
173are a number of other variables, `runltp` usually sets these for you.
174
175Note that all shell scripts need the `PATH` to be set. However this is not
176limited to shell scripts, many C based tests need environment variables as
177well.
178
179For more info see `doc/User-Guidelines.asciidoc` or online at
180https://github.com/linux-test-project/ltp/wiki/User-Guidelines.
181
182Network tests
183-------------
184Network tests require certain setup, described in `testcases/network/README.md`
185(online at https://github.com/linux-test-project/ltp/tree/master/testcases/network).
186
187Containers
188----------
189
190*Presently running the LTP inside a container is not a shortcut. It
191will make things much harder for you.*
192
193There is a Containerfile which can be used with Docker or
194Podman. Currently it can build Alpine and OpenSUSE images.
195
196The container can be built with a command like:
197
198```
199$ podman build -t tumbleweed/ltp \
200       --build-arg PREFIX=registry.opensuse.org/opensuse/ \
201       --build-arg DISTRO_NAME=tumbleweed \
202       --build-arg DISTRO_RELEASE=20230925 .
203```
204
205Or just `podman build .` which will create an Alpine container.
206
207It contains Kirk in /opt/kirk. So the following will run some tests.
208
209```
210$ podman run -it --rm tumbleweed/ltp:latest
211$ cd /opt/kirk && ./kirk -f ltp -r syscalls
212```
213
214SUSE also publishes a
215[smaller LTP container](https://registry.opensuse.org/cgi-bin/cooverview?srch_term=project%3D%5Ebenchmark+container%3D.*)
216that is not based on the Containerfile.
217
218Debugging with gdb
219==================
220
221The new test library runs the actual test, i.e. the `test()` function in a
222forked process. To get stack trace of a crashing test in gdb it's needed to
223[`set follow-fork-mode child`](https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_25.html).
224
225Developers corner
226=================
227
228Before you start you should read following documents:
229
230* `doc/Test-Writing-Guidelines.asciidoc`
231* `doc/Build-System.asciidoc`
232* `doc/LTP-Library-API-Writing-Guidelines.asciidoc`
233
234There is also a step-by-step tutorial:
235
236* `doc/C-Test-Case-Tutorial.asciidoc`
237
238If something is not covered there don't hesitate to ask on the LTP mailing
239list. Also note that these documents are available online at:
240
241* https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines
242* https://github.com/linux-test-project/ltp/wiki/LTP-Library-API-Writing-Guidelines
243* https://github.com/linux-test-project/ltp/wiki/Build-System
244* https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial
245
246Although we accept GitHub pull requests, the preferred way is sending patches to our mailing list.
247
248It's a good idea to test patches on GitHub Actions before posting to mailing
249list. Our GitHub Actions setup covers various architectures and distributions in
250order to make sure LTP compiles cleanly on most common configurations.
251For testing you need to just push your changes to your own LTP fork on GitHub.
252