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