blob: 55d5177fed03f0209f30ad2dc86736a1ec545c63 [file] [log] [blame]
alaffin198500d2000-08-21 22:18:17 +00001Linux Test Project
shubhamd3d634a2011-12-30 00:40:55 +05302(Maintained by: Shubham Goyal <shubham@linux.vnet.ibm.com>)
robbiew6f3a9f32002-06-07 18:21:19 +00003
4The latest image is always available at http://ltp.sf.net
alaffin198500d2000-08-21 22:18:17 +00005
Rishikesh K Rajak6feffd82010-02-15 19:20:14 +05306About the Linux Test Project::
alaffin198500d2000-08-21 22:18:17 +00007
robbiew9ea3ce72001-09-18 20:38:09 +00008The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a
robbiew0eea3522004-02-05 17:33:10 +00009goal to deliver test suites to the open source community that validate the
10reliability, robustness, and stability of Linux. The Linux Test Project is a
11collection of tools for testing the Linux kernel and related features. Our goal
12is to improve the Linux kernel by bringing test automation to the kernel testing
robbiew9ea3ce72001-09-18 20:38:09 +000013effort. Interested open source contributors are encouraged to join the project.
alaffin198500d2000-08-21 22:18:17 +000014
nstraz0312c252000-09-26 20:59:21 +000015
16In the Package
alaffin198500d2000-08-21 22:18:17 +000017--------------
nstraz0312c252000-09-26 20:59:21 +000018Here is a short description of what is included in this package
alaffin198500d2000-08-21 22:18:17 +000019
nstraz0312c252000-09-26 20:59:21 +000020INSTALL
21 Installation documentation and quick start guide
alaffin198500d2000-08-21 22:18:17 +000022
nstraz0312c252000-09-26 20:59:21 +000023README
24 This document
alaffin198500d2000-08-21 22:18:17 +000025
nstraz0312c252000-09-26 20:59:21 +000026CREDITS
27 Credits to those who have contributed to the project.
alaffin198500d2000-08-21 22:18:17 +000028
nstraz0312c252000-09-26 20:59:21 +000029COPYING
Garrett Cooper11124022010-08-05 06:09:07 -070030 GNU General Public License
alaffin198500d2000-08-21 22:18:17 +000031
Peng Haitao5de138b2012-01-09 10:58:26 +080032VERSION
33 LTP Version.
nstrazf307d5f2000-09-14 21:54:44 +000034
nstraz0312c252000-09-26 20:59:21 +000035Makefile
Garrett Cooper11124022010-08-05 06:09:07 -070036 Top level make file for LTP.
nstraz0312c252000-09-26 20:59:21 +000037
38runalltests.sh
39 A simple script to run all of the packaged tests in sequential order and
Garrett Cooper11124022010-08-05 06:09:07 -070040 report the overall result.
nstraz0312c252000-09-26 20:59:21 +000041
robbiew9ea3ce72001-09-18 20:38:09 +000042diskio.sh
nstrazd226d9d2002-01-09 23:03:50 +000043 A simple script to run all the diskio tests that pertain to the CD-ROM
44 and floppy disk file systems.
robbiew9ea3ce72001-09-18 20:38:09 +000045
46networktests.sh
nstrazd226d9d2002-01-09 23:03:50 +000047 A simple script to run all the network related tests that require
48 another remote machine.
robbiew9ea3ce72001-09-18 20:38:09 +000049
nstraz0312c252000-09-26 20:59:21 +000050doc/*
51 Documentation for the project including man pages for some of the
robbiewca0a7de2001-09-25 18:58:43 +000052 tools & library functions, as well as descriptions of every test.
nstraz0312c252000-09-26 20:59:21 +000053
nstraz0312c252000-09-26 20:59:21 +000054
55include/*
56lib/*
57 The include and lib directories contain headers and codes for common
58 routines used by many of the tests. We have tried to keep this to a
Garrett Cooper11124022010-08-05 06:09:07 -070059 minimum.
nstraz0312c252000-09-26 20:59:21 +000060
robbiew9ea3ce72001-09-18 20:38:09 +000061testcases/*
nstrazd226d9d2002-01-09 23:03:50 +000062 Contains all tests that run under the LTP as well as the "bin"
Garrett Cooper11124022010-08-05 06:09:07 -070063 directory, which has hardlinks to all the test executables.
nstraz0312c252000-09-26 20:59:21 +000064
65runtest/*
subrata_modakdddeb902009-05-29 10:06:08 +000066 It houses command lists that are used by ltp-pan for automated testing.
robbiew9ea3ce72001-09-18 20:38:09 +000067
nstraz0312c252000-09-26 20:59:21 +000068pan/*
subrata_modakdddeb902009-05-29 10:06:08 +000069 The pan directory contains a simple, lightweight test harness. lpt-pan
70 has the ability to run tests randomly and in parallel. See ltp-pan's man
nstraz0312c252000-09-26 20:59:21 +000071 page for more information.
alaffin198500d2000-08-21 22:18:17 +000072
nstrazd226d9d2002-01-09 23:03:50 +000073scratch/*
74 The scratch directory is a dumping ground for snippets and test cases
75 that we found but haven't integrated into LTP yet. Feel free to suggest
76 new snippets to be added, or take one of these and finish it off.
alaffin198500d2000-08-21 22:18:17 +000077
subrata_modak0c5f9702007-04-26 11:02:47 +000078testcases/kernel/containers/*
subrata_modak8cd73052007-06-22 10:28:26 +000079 Contains all the testcases related to container functionality ( e.g: sysvipc, utsname etc..)
subrata_modak0c5f9702007-04-26 11:02:47 +000080 For further information on the each of the container functionality refer
81 the following file: testcases/kernel/containers/README
82
83
nstraz0312c252000-09-26 20:59:21 +000084Warning!
85--------
alaffin198500d2000-08-21 22:18:17 +000086Be careful with these tests!
87
88Don't run them on production systems. Growfiles, doio, and iogen in particular
89stress the I/O capabilities of systems and while they should not cause problems
90on properly functioning systems, they are intended to find (or cause) problems.
nstraz0312c252000-09-26 20:59:21 +000091
92
93Contact Information and Updates
94-------------------------------
95
robbiew9ea3ce72001-09-18 20:38:09 +000096URL: http://ltp.sf.net
nstraz0312c252000-09-26 20:59:21 +000097
nstrazd226d9d2002-01-09 23:03:50 +000098Questions and comments should be sent to the LTP mailing list located on the
robbiew0eea3522004-02-05 17:33:10 +000099project page.
nstraz0312c252000-09-26 20:59:21 +0000100
subrata_modak23f869f2007-04-09 12:03:49 +0000101Using KDUMP test automation suite
102---------------------------------
subrata_modak23f869f2007-04-09 12:03:49 +0000103For more information on how to use the kdump test automation suite please refer
104to file testcases/kdump/README.
105
subrata_modak9b555d12007-08-24 09:41:59 +0000106Using NUMA test automation suite
107---------------------------------
108For more information on how to use the 'numa' test automation suite please refer
109to file testcases/kernel/numa/README.
110
subrata_modakb8f04cd2008-10-24 08:24:37 +0000111---------------------------------
112Enable CODE COVERAGE for your Kernel:
113---------------------------------
1141) Apply kernel-gcov patch(s) against the corresponding Kernel. They are available here:
115http://ltp.cvs.sourceforge.net/viewvc/ltp/utils/analysis/gcov-kernel/linux-2.*.*-gcov.patch?view=log,
1162) Also enable the following options in your .config file before building the kernel
117CONFIG_GCOV_PROFILE=y
118CONFIG_GCOV_ALL=y
119CONFIG_GCOV_PROC=m
120CONFIG_GCOV_HAMMER=y
121
122---------------------------------
123Enabling Kernel Configuration to test Containers/Namespaces
124---------------------------------
125CONFIG_NAMESPACES=y
126CONFIG_UTS_NS=y
127CONFIG_IPC_NS=y
128CONFIG_USER_NS=y
129CONFIG_PID_NS=y
130CONFIG_NET_NS=y
131CONFIG_VETH=y
132CONFIG_MACVLAN=y
133
subrata_modak09be6112009-03-04 07:03:41 +0000134The IPC namespaces do not automatically enable IPC, so you may
135also want to have:
136
137CONFIG_SYSVIPC=y
138CONFIG_SYSVIPC_SYSCTL=y
139CONFIG_POSIX_MQUEUE=y
subrata_modakb8f04cd2008-10-24 08:24:37 +0000140
141---------------------------------
142Enabling Kernel Configuration to test Controllers
143---------------------------------
144CONFIG_CGROUPS=y
145CONFIG_CGROUP_DEBUG=y
146CONFIG_CGROUP_NS=y
147CONFIG_GROUP_SCHED=y
148CONFIG_FAIR_GROUP_SCHED=y
149CONFIG_RT_GROUP_SCHED=y
150CONFIG_CGROUP_SCHED=y
subrata_modake1425aa2009-04-25 17:41:02 +0000151CONFIG_CGROUP_MEM_RES_CTLR=y
152CONFIG_LOCKDEP=y
subrata_modakb8f04cd2008-10-24 08:24:37 +0000153---------------------------------
154Enabling Kernel Configuration to test Power Management features
155---------------------------------
156CONFIG_CPU_FREQ=y
157CONFIG_CPU_FREQ_TABLE=y
158CONFIG_CPU_FREQ_DEBUG=y
159CONFIG_CPU_FREQ_STAT=y
160CONFIG_CPU_FREQ_STAT_DETAILS=y
161CONFIG_CPU_IDLE=y
162CONFIG_CPU_IDLE_GOV_LADDER=y
163CONFIG_CPU_IDLE_GOV_MENU=y
164CONFIG_SCHED_MC=y
165CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
166CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
167CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
168CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
169CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE=y
170CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
171CONFIG_CPU_FREQ_GOV_POWERSAVE=y
172CONFIG_CPU_FREQ_GOV_USERSPACE=y
173CONFIG_CPU_FREQ_GOV_ONDEMAND=y
174CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
175---------------------------------
subrata_modakd1ece562008-11-03 10:09:30 +0000176Enabling Kernel Configuration to test filecaps security feature
177---------------------------------
subrata_modakd2612012009-06-02 08:06:40 +0000178CONFIG_SECURITY_FILE_CAPABILITIES=y
subrata_modakd1ece562008-11-03 10:09:30 +0000179---------------------------------
subrata_modak0aeb2c72009-09-21 15:48:09 +0000180Enabling Kernel Configuration to test p9auth security feature
181---------------------------------
182CONFIG_CRYPTO=y
183CONFIG_STAGING=y
184# CONFIG_STAGING_EXCLUDE_BUILD is not set
185CONFIG_PLAN9AUTH=m
186(Or CONFIG_PLAN9AUTH=y)
187You also will need openssl installed.
188You will also need to have an user named 'ltp'
189created to execute this test.
190---------------------------------
subrata_modaka8b1aee2008-11-07 09:19:07 +0000191Enabling Kernel Configuration to test SELinux security feature
192---------------------------------
193Your Kernel should have been built with the following options to
194test SELinux:
subrata_modakd1ece562008-11-03 10:09:30 +0000195
subrata_modaka8b1aee2008-11-07 09:19:07 +0000196CONFIG_SECURITY=y
197CONFIG_SECURITY_NETWORK=y
198CONFIG_SECURITY_NETWORK_XFRM=y
subrata_modaka8b1aee2008-11-07 09:19:07 +0000199
200CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
201This has to be set to a positive value if you want to test this check.
202Fedora kernels set it to 65536.
203
204CONFIG_SECURITY_SELINUX=y
205CONFIG_SECURITY_SELINUX_BOOTPARAM=y
206CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
207CONFIG_SECURITY_SELINUX_DEVELOP=y
208CONFIG_SECURITY_SELINUX_AVC_STATS=y
209CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
210CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT=y
211
212CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX=y
Caspar Zhang68d1eb62012-03-09 00:18:01 +0800213You don't want this one unless you are running Fedora 3 or 4.
subrata_modaka8b1aee2008-11-07 09:19:07 +0000214On anything newer, it will cause unnecessary policy expansion.
215
216CONFIG_SECURITY_SMACK=y
217CONFIG_SECURITY_SELINUX=y
218
219By default, if you boot with multiple LSMs compiled into the kernel, the
220kernel won't boot succesfully - there can be only one (aside from
221explicit internal "stacking" e.g. as is done for combining SELinux or
222Smack with capabilities). Unless you use the security= option to select
223one at boot. SELinux and Smack will honor the security= option.
224---------------------------------
subrata_modak6c7dfab2009-03-19 07:27:04 +0000225---------------------------------
226Enabling Kernel Configuration to test SMACK security feature
227---------------------------------
228CONFIG_NETLABEL=y
229CONFIG_SECURITY=y
230CONFIG_SECURITY_NETWORK=y
231CONFIG_SECURITY_SMACK=y
232CONFIG_SECURITY_SELINUX should not be set
233
234For more information to build/install/run these tests, look through:
235ltp/testcases/kernel/security/smack/README
236---------------------------------
237---------------------------------
subrata_modak138ce8c2008-11-25 13:06:58 +0000238Enablement for Enhancement to kexec/kdump for implementing the following features:
239- Backup/restore memory used by the original kernel before/after kexec.
240- Save/restore CPU state before/after kexec.
241Now, only the i386 architecture is supported. More from the following git logs:
242http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3ab83521378268044a448113c6aa9a9e245f4d2f,
243http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89081d17f7bb81d89fa1aa9b70f821c5cf4d39e9,
244---------------------------------
245CONFIG_X86_32=y
246CONFIG_RELOCATABLE=y
247CONFIG_KEXEC=y
248CONFIG_CRASH_DUMP=y
249CONFIG_PM=y
250CONFIG_HIBERNATION=y
251CONFIG_KEXEC_JUMP=y
252---------------------------------
subrata_modak6111aa82008-12-29 11:04:15 +0000253Enabling HOTPLUG for your Kernels
254---------------------------------
255CONFIG_HOTPLUG=y
256CONFIG_HOTPLUG_CPU=y
257CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
258CONFIG_ACPI_HOTPLUG_CPU=y
259CONFIG_HOTPLUG_PCI_PCIE=y
260CONFIG_HOTPLUG_PCI=y
261CONFIG_HOTPLUG_PCI_FAKE=y
262CONFIG_HOTPLUG_PCI_COMPAQ=y
263CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y
264CONFIG_HOTPLUG_PCI_IBM=y
265CONFIG_HOTPLUG_PCI_ACPI=y
266CONFIG_HOTPLUG_PCI_ACPI_IBM=y
267CONFIG_HOTPLUG_PCI_CPCI=y
268CONFIG_HOTPLUG_PCI_CPCI_ZT5550=y
269CONFIG_HOTPLUG_PCI_CPCI_GENERIC=y
270CONFIG_HOTPLUG_PCI_SHPC=y
271---------------------------------
subrata_modak7a86bf32008-12-30 07:32:53 +0000272Video For Linux Two API testing Requirements:
273You 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:
274 -> Device Drivers
275 -> Multimedia devices
276 -> Video For Linux
277 -> Video capture adapters
278 -> Virtual Video Driver
279
280The tests also require CUnit Framework to be installed before compiling the tests. Download & Install the same from:
281http://sourceforge.net/projects/cunit/
282---------------------------------
subrata_modak138ce8c2008-11-25 13:06:58 +0000283---------------------------------
subrata_modak250df922009-01-15 09:17:14 +0000284Native language support (nls) testsuite requirements
285----------------------------------------------------
286CONFIG_NLS=m
287CONFIG_BLOCK=y
subrata_modakfcce6dd2009-03-02 15:39:45 +0000288---------------------------------
289Enabling Controller area network (CAN) protocol support for your Kernels
290---------------------------------
291CONFIG_NET=y
292CONFIG_CAN=m
293CONFIG_CAN_RAW=m
294CONFIG_CAN_BCM=m
295# CAN Device Drivers
296CONFIG_CAN_VCAN=m
297---------------------------------
subrata_modak82d4d1d2009-08-22 12:40:23 +0000298Enabling Fault Injection Support for your kernel (version 2.6.29).
299Please check with the original kernel for the fault injection
300types it supports. Following supports will be available:
301
302/sys/kernel/debug/fail_io_timeout/interval
303/sys/kernel/debug/fail_io_timeout/probability
304/sys/kernel/debug/fail_io_timeout/reject-end
305/sys/kernel/debug/fail_io_timeout/reject-start
306/sys/kernel/debug/fail_io_timeout/require-end
307/sys/kernel/debug/fail_io_timeout/require-start
308/sys/kernel/debug/fail_io_timeout/space
309/sys/kernel/debug/fail_io_timeout/stacktrace-depth
310/sys/kernel/debug/fail_io_timeout/task-filter
311/sys/kernel/debug/fail_io_timeout/times
312/sys/kernel/debug/fail_io_timeout/verbose
313
314/sys/kernel/debug/fail_make_request/interval
315/sys/kernel/debug/fail_make_request/probability
316/sys/kernel/debug/fail_make_request/reject-end
317/sys/kernel/debug/fail_make_request/reject-start
318/sys/kernel/debug/fail_make_request/require-end
319/sys/kernel/debug/fail_make_request/require-start
320/sys/kernel/debug/fail_make_request/space
321/sys/kernel/debug/fail_make_request/stacktrace-depth
322/sys/kernel/debug/fail_make_request/task-filter
323/sys/kernel/debug/fail_make_request/times
324/sys/kernel/debug/fail_make_request/verbose
325
326/sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem
327/sys/kernel/debug/fail_page_alloc/ignore-gfp-wait
328/sys/kernel/debug/fail_page_alloc/interval
329/sys/kernel/debug/fail_page_alloc/min-order
330/sys/kernel/debug/fail_page_alloc/probability
331/sys/kernel/debug/fail_page_alloc/reject-end
332/sys/kernel/debug/fail_page_alloc/reject-start
333/sys/kernel/debug/fail_page_alloc/require-end
334/sys/kernel/debug/fail_page_alloc/require-start
335/sys/kernel/debug/fail_page_alloc/space
336/sys/kernel/debug/fail_page_alloc/stacktrace-depth
337/sys/kernel/debug/fail_page_alloc/task-filter
338/sys/kernel/debug/fail_page_alloc/times
339/sys/kernel/debug/fail_page_alloc/verbose
340
341/sys/kernel/debug/failslab/ignore-gfp-wait
342/sys/kernel/debug/failslab/interval
343/sys/kernel/debug/failslab/probability
344/sys/kernel/debug/failslab/reject-end
345/sys/kernel/debug/failslab/reject-start
346/sys/kernel/debug/failslab/require-end
347/sys/kernel/debug/failslab/require-start
348/sys/kernel/debug/failslab/space
349/sys/kernel/debug/failslab/stacktrace-depth
350/sys/kernel/debug/failslab/task-filter
351/sys/kernel/debug/failslab/times
352/sys/kernel/debug/failslab/verbose
353
354when the below kernel config options are set:
355
356CONFIG_FAULT_INJECTION=y
357CONFIG_DEBUG_KERNEL=y
358CONFIG_FAILSLAB=y (Fault-injection capability for kmalloc)
359(CONFIG_SLAB=y || CONFIG_SLUB=y) if CONFIG_FAILSLAB=y
360CONFIG_FAIL_PAGE_ALLOC=y (Fault-injection capabilitiy for alloc_pages())
361CONFIG_FAIL_MAKE_REQUEST=y (Fault-injection capability for disk IO)
362CONFIG_BLOCK=y if CONFIG_FAIL_MAKE_REQUEST=y
363CONFIG_FAIL_IO_TIMEOUT=y (Faul-injection capability for faking disk interrupts)
364CONFIG_BLOCK=y if CONFIG_FAIL_IO_TIMEOUT=y
365CONFIG_FAULT_INJECTION_DEBUG_FS=y (Debugfs entries for fault-injection capabilities)
366(CONFIG_SYSFS=y && CONFIG_DEBUG_FS=y) if CONFIG_FAULT_INJECTION_DEBUG_FS=y
367CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y (stacktrace filter for fault-injection capabilities)
368(CONFIG_FAULT_INJECTION_DEBUG_FS=y && CONFIG_STACKTRACE_SUPPORT=y && !CONFIG_X86_64) if
369 CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
370
371For more information on Fault injection, please refer to:
372linux-2.6/Documentation/fault-injection/fault-injection.txt,
373
374You should also have made the following entries in your /etc/fstab file
375once the kernel is booted with the above CONFIG options set:
376
377debugfs /sys/kernel/debug/ debugfs
378
379# How the Kernel Fault Injection works for LTP ?
380
3811) Build Kernel with all the above possible kernel CONFIG Options,
3822) Create the above entry in /etc/fstab file,
3833) Reboot in the new kernel,
3844) Goto LTPROOT. Build and Install LTP as per ltp/INSTALL file,
3855) Choose your own test(or default) to run with fault injection as follows:
386 ./runltp -f <command_file> -F <LOOPS>,<FAULT_PROBABILITY>
387
Garrett Cooperd639eef2010-02-18 23:47:44 -0800388The algorithm functions like:
subrata_modak82d4d1d2009-08-22 12:40:23 +0000389loop (for each testcase)
390begin
391 execute_testcase(inside_stable_kernel)
392 begin
393 insert_fault_into_kernel()
394 loop X Times
395 begin
396 execute_testcase(inside_fault_kernel)
397 end
398 restore_kernel_to_normal()
399 end
400end
401
Garrett Cooperd639eef2010-02-18 23:47:44 -0800402# External TODOs:
4031) Add or modify testcases when relevant kernel functionality changes.
subrata_modak82d4d1d2009-08-22 12:40:23 +0000404---------------------------------
subrata_modakfcce6dd2009-03-02 15:39:45 +0000405
subrata_modak55d04e42009-10-26 11:25:55 +0000406---------------------------------
407Enabling Kernel Configuration to test ext4 new features
408---------------------------------
409CONFIG_EXT4_FS=y
410CONFIG_EXT4DEV_COMPAT=y
411CONFIG_EXT4_FS_XATTR=y
412CONFIG_EXT4_FS_POSIX_ACL=y
413CONFIG_EXT4_FS_SECURITY=y
414
415Beside that, the following packages are necessary.
416 e2fsprogs
417 e2fsprogs-devel
418 e2fsprogs-libs
419And the version of packages must be 1.41.4 or above.
420
421For more information to build/install/run these tests, look through:
422ltp/testcases/kernel/fs/ext4-new-features/README
423---------------------------------