• Home
Name Date Size #Lines LOC

..--

ci/07-Sep-2024-230178

doc/07-Sep-2024-14,24110,855

docparse/07-Sep-2024-848657

include/07-Sep-2024-25,41717,266

lib/07-Sep-2024-27,52019,068

libs/07-Sep-2024-1,7421,172

m4/07-Sep-2024-1,017858

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

pan/07-Sep-2024-5,4033,356

runtest/07-Sep-2024-5,1364,464

scenario_groups/07-Sep-2024-9461

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

testcases/07-Sep-2024-796,322517,362

testscripts/07-Sep-2024-2,1101,381

tools/07-Sep-2024-82,19455,467

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

.gitignoreD07-Sep-2024646 6356

.gitmodulesD07-Sep-2024489 1312

.mailmapD07-Sep-2024112 32

COPYINGD07-Sep-202417.7 KiB340281

IDcheck.shD07-Sep-20245 KiB197136

INSTALLD07-Sep-20248.7 KiB249181

MakefileD07-Sep-20246.8 KiB225135

Makefile.releaseD07-Sep-20241.4 KiB4713

OAT.xmlD07-Sep-20248 KiB11054

README.OpenSourceD07-Sep-2024464 1211

README.kernel_configD07-Sep-202410.7 KiB303274

README.mdD07-Sep-20246 KiB214154

TODOD07-Sep-20241.3 KiB4026

VERSIOND07-Sep-20249 21

build.shD07-Sep-20245.8 KiB252202

bundle.jsonD07-Sep-2024776 3231

configure.acD07-Sep-202411.5 KiB457404

execltp.inD07-Sep-202416 KiB475326

ltpmenuD07-Sep-202419 KiB549321

runltpD07-Sep-202435.7 KiB960746

ver_linuxD07-Sep-20243.9 KiB176126

README.OpenSource

1[
2    {
3        "Name"                  : "ltp",
4        "License"               : "GPL V2.0",
5        "License File"          : "COPYING",
6        "Version Number"        : "20230929",
7        "Owner"                 : "liuxun@huawei.com",
8        "Upstream URL"          : "https://github.com/linux-test-project/ltp",
9        "Description"           : "The LTP testsuite contains a collection of tools for testing the Linux kernel and related features."
10    }
11]
12

README.kernel_config

1---------------------------------
2Enable CODE COVERAGE for your Kernel:
3---------------------------------
41) Apply kernel-gcov patch(s) against the corresponding Kernel. They are available here:
5http://ltp.cvs.sourceforge.net/viewvc/ltp/utils/analysis/gcov-kernel/linux-2.*.*-gcov.patch?view=log,
62) Also enable the following options in your .config file before building the kernel
7CONFIG_GCOV_PROFILE=y
8CONFIG_GCOV_ALL=y
9CONFIG_GCOV_PROC=m
10CONFIG_GCOV_HAMMER=y
11
12---------------------------------
13Enabling Kernel Configuration to test Containers/Namespaces
14---------------------------------
15CONFIG_NAMESPACES=y
16CONFIG_UTS_NS=y
17CONFIG_IPC_NS=y
18CONFIG_USER_NS=y
19CONFIG_PID_NS=y
20CONFIG_NET_NS=y
21CONFIG_VETH=y
22CONFIG_MACVLAN=y
23
24The IPC namespaces do not automatically enable IPC, so you may
25also want to have:
26
27CONFIG_SYSVIPC=y
28CONFIG_SYSVIPC_SYSCTL=y
29CONFIG_POSIX_MQUEUE=y
30
31---------------------------------
32Enabling Kernel Configuration to test Controllers
33---------------------------------
34CONFIG_CGROUPS=y
35CONFIG_CGROUP_DEBUG=y
36CONFIG_CGROUP_NS=y
37CONFIG_GROUP_SCHED=y
38CONFIG_FAIR_GROUP_SCHED=y
39CONFIG_RT_GROUP_SCHED=y
40CONFIG_CGROUP_SCHED=y
41CONFIG_CGROUP_MEM_RES_CTLR=y
42CONFIG_LOCKDEP=y
43---------------------------------
44Enabling Kernel Configuration to test Power Management features
45---------------------------------
46CONFIG_CPU_FREQ=y
47CONFIG_CPU_FREQ_TABLE=y
48CONFIG_CPU_FREQ_DEBUG=y
49CONFIG_CPU_FREQ_STAT=y
50CONFIG_CPU_FREQ_STAT_DETAILS=y
51CONFIG_CPU_IDLE=y
52CONFIG_CPU_IDLE_GOV_LADDER=y
53CONFIG_CPU_IDLE_GOV_MENU=y
54CONFIG_SCHED_MC=y
55CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
56CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
57CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
58CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
59CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE=y
60CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
61CONFIG_CPU_FREQ_GOV_POWERSAVE=y
62CONFIG_CPU_FREQ_GOV_USERSPACE=y
63CONFIG_CPU_FREQ_GOV_ONDEMAND=y
64CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
65---------------------------------
66Enabling Kernel Configuration to test filecaps security feature
67---------------------------------
68CONFIG_SECURITY_FILE_CAPABILITIES=y
69---------------------------------
70Enabling Kernel Configuration to test SELinux security feature
71---------------------------------
72Your Kernel should have been built with the following options to
73test SELinux:
74
75CONFIG_SECURITY=y
76CONFIG_SECURITY_NETWORK=y
77CONFIG_SECURITY_NETWORK_XFRM=y
78
79CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
80This has to be set to a positive value if you want to test this check.
81Fedora kernels set it to 65536.
82
83CONFIG_SECURITY_SELINUX=y
84CONFIG_SECURITY_SELINUX_BOOTPARAM=y
85CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
86CONFIG_SECURITY_SELINUX_DEVELOP=y
87CONFIG_SECURITY_SELINUX_AVC_STATS=y
88CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
89CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT=y
90
91CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX=y
92You don't want this one unless you are running Fedora 3 or 4.
93On anything newer, it will cause unnecessary policy expansion.
94
95CONFIG_SECURITY_SMACK=y
96CONFIG_SECURITY_SELINUX=y
97
98By default, if you boot with multiple LSMs compiled into the kernel, the
99kernel won't boot succesfully - there can be only one (aside from
100explicit internal "stacking" e.g. as is done for combining SELinux or
101Smack with capabilities).  Unless you use the security= option to select
102one at boot.  SELinux and Smack will honor the security= option.
103---------------------------------
104---------------------------------
105Enabling Kernel Configuration to test SMACK security feature
106---------------------------------
107CONFIG_NETLABEL=y
108CONFIG_SECURITY=y
109CONFIG_SECURITY_NETWORK=y
110CONFIG_SECURITY_SMACK=y
111CONFIG_SECURITY_SELINUX should not be set
112
113For more information to build/install/run these tests, look through:
114ltp/testcases/kernel/security/smack/README
115---------------------------------
116---------------------------------
117Enablement for Enhancement to kexec/kdump for implementing the following features:
118- Backup/restore memory used by the original kernel before/after kexec.
119- Save/restore CPU state before/after kexec.
120Now, only the i386 architecture is supported. More from the following git logs:
121http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3ab83521378268044a448113c6aa9a9e245f4d2f,
122http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89081d17f7bb81d89fa1aa9b70f821c5cf4d39e9,
123---------------------------------
124CONFIG_X86_32=y
125CONFIG_RELOCATABLE=y
126CONFIG_KEXEC=y
127CONFIG_CRASH_DUMP=y
128CONFIG_PM=y
129CONFIG_HIBERNATION=y
130CONFIG_KEXEC_JUMP=y
131---------------------------------
132Enabling HOTPLUG for your Kernels
133---------------------------------
134CONFIG_HOTPLUG=y
135CONFIG_HOTPLUG_CPU=y
136CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
137CONFIG_ACPI_HOTPLUG_CPU=y
138CONFIG_HOTPLUG_PCI_PCIE=y
139CONFIG_HOTPLUG_PCI=y
140CONFIG_HOTPLUG_PCI_FAKE=y
141CONFIG_HOTPLUG_PCI_COMPAQ=y
142CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y
143CONFIG_HOTPLUG_PCI_IBM=y
144CONFIG_HOTPLUG_PCI_ACPI=y
145CONFIG_HOTPLUG_PCI_ACPI_IBM=y
146CONFIG_HOTPLUG_PCI_CPCI=y
147CONFIG_HOTPLUG_PCI_CPCI_ZT5550=y
148CONFIG_HOTPLUG_PCI_CPCI_GENERIC=y
149CONFIG_HOTPLUG_PCI_SHPC=y
150---------------------------------
151Video For Linux Two API testing Requirements:
152You need to have a video device (i.e. webcam, tuner card, etc.) connected to your system and available under /dev/video0. If you don't have any hardware device available, you can still test the "Virtual Video Driver". To compile this you need to compile your kernel with CONFIG_VIDEO_VIVI=m under:
153  -> Device Drivers
154    -> Multimedia devices
155      -> Video For Linux
156        -> Video capture adapters
157         -> Virtual Video Driver
158
159The tests also require CUnit Framework to be installed before compiling the tests. Download & Install the same from:
160http://sourceforge.net/projects/cunit/
161---------------------------------
162---------------------------------
163Native language support (nls) testsuite requirements
164----------------------------------------------------
165CONFIG_NLS=m
166CONFIG_BLOCK=y
167---------------------------------
168Enabling Controller area network (CAN) protocol support for your Kernels
169---------------------------------
170CONFIG_NET=y
171CONFIG_CAN=m
172CONFIG_CAN_RAW=m
173CONFIG_CAN_BCM=m
174# CAN Device Drivers
175CONFIG_CAN_VCAN=m
176---------------------------------
177Enabling Fault Injection Support for your kernel (version 2.6.29).
178Please check with the original kernel for the fault injection
179types it supports. Following supports will be available:
180
181/sys/kernel/debug/fail_io_timeout/interval
182/sys/kernel/debug/fail_io_timeout/probability
183/sys/kernel/debug/fail_io_timeout/reject-end
184/sys/kernel/debug/fail_io_timeout/reject-start
185/sys/kernel/debug/fail_io_timeout/require-end
186/sys/kernel/debug/fail_io_timeout/require-start
187/sys/kernel/debug/fail_io_timeout/space
188/sys/kernel/debug/fail_io_timeout/stacktrace-depth
189/sys/kernel/debug/fail_io_timeout/task-filter
190/sys/kernel/debug/fail_io_timeout/times
191/sys/kernel/debug/fail_io_timeout/verbose
192
193/sys/kernel/debug/fail_make_request/interval
194/sys/kernel/debug/fail_make_request/probability
195/sys/kernel/debug/fail_make_request/reject-end
196/sys/kernel/debug/fail_make_request/reject-start
197/sys/kernel/debug/fail_make_request/require-end
198/sys/kernel/debug/fail_make_request/require-start
199/sys/kernel/debug/fail_make_request/space
200/sys/kernel/debug/fail_make_request/stacktrace-depth
201/sys/kernel/debug/fail_make_request/task-filter
202/sys/kernel/debug/fail_make_request/times
203/sys/kernel/debug/fail_make_request/verbose
204
205/sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem
206/sys/kernel/debug/fail_page_alloc/ignore-gfp-wait
207/sys/kernel/debug/fail_page_alloc/interval
208/sys/kernel/debug/fail_page_alloc/min-order
209/sys/kernel/debug/fail_page_alloc/probability
210/sys/kernel/debug/fail_page_alloc/reject-end
211/sys/kernel/debug/fail_page_alloc/reject-start
212/sys/kernel/debug/fail_page_alloc/require-end
213/sys/kernel/debug/fail_page_alloc/require-start
214/sys/kernel/debug/fail_page_alloc/space
215/sys/kernel/debug/fail_page_alloc/stacktrace-depth
216/sys/kernel/debug/fail_page_alloc/task-filter
217/sys/kernel/debug/fail_page_alloc/times
218/sys/kernel/debug/fail_page_alloc/verbose
219
220/sys/kernel/debug/failslab/ignore-gfp-wait
221/sys/kernel/debug/failslab/interval
222/sys/kernel/debug/failslab/probability
223/sys/kernel/debug/failslab/reject-end
224/sys/kernel/debug/failslab/reject-start
225/sys/kernel/debug/failslab/require-end
226/sys/kernel/debug/failslab/require-start
227/sys/kernel/debug/failslab/space
228/sys/kernel/debug/failslab/stacktrace-depth
229/sys/kernel/debug/failslab/task-filter
230/sys/kernel/debug/failslab/times
231/sys/kernel/debug/failslab/verbose
232
233when the below kernel config options are set:
234
235CONFIG_FAULT_INJECTION=y
236CONFIG_DEBUG_KERNEL=y
237CONFIG_FAILSLAB=y (Fault-injection capability for kmalloc)
238(CONFIG_SLAB=y || CONFIG_SLUB=y) if CONFIG_FAILSLAB=y
239CONFIG_FAIL_PAGE_ALLOC=y (Fault-injection capabilitiy for alloc_pages())
240CONFIG_FAIL_MAKE_REQUEST=y (Fault-injection capability for disk IO)
241CONFIG_BLOCK=y if CONFIG_FAIL_MAKE_REQUEST=y
242CONFIG_FAIL_IO_TIMEOUT=y (Faul-injection capability for faking disk interrupts)
243CONFIG_BLOCK=y if CONFIG_FAIL_IO_TIMEOUT=y
244CONFIG_FAULT_INJECTION_DEBUG_FS=y (Debugfs entries for fault-injection capabilities)
245(CONFIG_SYSFS=y && CONFIG_DEBUG_FS=y) if CONFIG_FAULT_INJECTION_DEBUG_FS=y
246CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y (stacktrace filter for fault-injection capabilities)
247(CONFIG_FAULT_INJECTION_DEBUG_FS=y && CONFIG_STACKTRACE_SUPPORT=y && !CONFIG_X86_64) if
248	CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
249
250For more information on Fault injection, please refer to:
251linux-2.6/Documentation/fault-injection/fault-injection.txt,
252
253You should also have made the following entries in your /etc/fstab file
254once the kernel is booted with the above CONFIG options set:
255
256debugfs		/sys/kernel/debug/		debugfs
257
258# How the Kernel Fault Injection works for LTP ?
259
2601) Build Kernel with all the above possible kernel CONFIG Options,
2612) Create the above entry in /etc/fstab file,
2623) Reboot in the new kernel,
2634) Goto LTPROOT. Build and Install LTP as per ltp/INSTALL file,
2645) Choose your own test(or default) to run with fault injection as follows:
265	./runltp -f <command_file> -F <LOOPS>,<FAULT_PROBABILITY>
266
267The algorithm functions like:
268loop (for each testcase)
269begin
270	execute_testcase(inside_stable_kernel)
271	begin
272		insert_fault_into_kernel()
273		loop X Times
274		begin
275			execute_testcase(inside_fault_kernel)
276		end
277		restore_kernel_to_normal()
278	end
279end
280
281# External TODOs:
2821) Add or modify testcases when relevant kernel functionality changes.
283---------------------------------
284
285---------------------------------
286Enabling Kernel Configuration to test ext4 new features
287---------------------------------
288CONFIG_EXT4_FS=y
289CONFIG_EXT4DEV_COMPAT=y
290CONFIG_EXT4_FS_XATTR=y
291CONFIG_EXT4_FS_POSIX_ACL=y
292CONFIG_EXT4_FS_SECURITY=y
293
294Beside that, the following packages are necessary.
295  e2fsprogs
296  e2fsprogs-devel
297  e2fsprogs-libs
298And the version of packages must be 1.41.4 or above.
299
300For more information to build/install/run these tests, look through:
301ltp/testcases/kernel/fs/ext4-new-features/README
302---------------------------------
303

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-guide.txt` 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
187Developers corner
188=================
189
190Before you start you should read following documents:
191
192* `doc/test-writing-guidelines.txt`
193* `doc/build-system-guide.txt`
194* `doc/library-api-writing-guidelines.txt`
195
196There is also a step-by-step tutorial:
197
198* `doc/c-test-tutorial-simple.txt`
199
200If something is not covered there don't hesitate to ask on the LTP mailing
201list. Also note that these documents are available online at:
202
203* https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines
204* https://github.com/linux-test-project/ltp/wiki/LTP-Library-API-Writing-Guidelines
205* https://github.com/linux-test-project/ltp/wiki/Build-System
206* https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial
207
208Although we accept GitHub pull requests, the preferred way is sending patches to our mailing list.
209
210It's a good idea to test patches on GitHub Actions before posting to mailing
211list. Our GitHub Actions setup covers various architectures and distributions in
212order to make sure LTP compiles cleanly on most common configurations.
213For testing you need to just push your changes to your own LTP fork on GitHub.
214