2 ################################################################################
4 ## Copyright (c) International Business Machines Corp., 2001 ##
6 ## This program is free software; you can redistribute it and#or modify ##
7 ## it under the terms of the GNU General Public License as published by ##
8 ## the Free Software Foundation; either version 2 of the License, or ##
9 ## (at your option) any later version. ##
11 ## This program is distributed in the hope that it will be useful, but ##
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
13 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
14 ## for more details. ##
16 ## You should have received a copy of the GNU General Public License ##
17 ## along with this program; if not, write to the Free Software ##
18 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ##
20 ################################################################################
21 ## File: runalltests.sh ##
23 ## Description: This script just calls runltp now, and is being phased out. ##
24 ## If you rely on this script for automation reasons, please ##
26 ## History Subrata Modak <subrata@linuc.vnet.ibm.com> changed the code ##
27 ## to include testing other testcases which are not run by ##
28 ## default, 08/09/2008 ##
30 ################################################################################
32 echo "*******************************************************************"
33 echo "*******************************************************************"
35 echo "** This script is being re-written to cover all aspects of **"
36 echo "** testing LTP, which includes running all those tests which **"
37 echo "** are not run by default with ./runltp script. Special setup **"
38 echo "** in system environment will be done to run all those tests **"
39 echo "** like the File System tests, SELinuxtest, etc **"
41 echo "*******************************************************************"
42 echo "*******************************************************************"
46 export RUN_OPENPOSIX
=0
47 ## Set this to 1 if mm-1.4.2.tar.gz is already installed in your system
48 ## from ftp://ftp.ossp.org/pkg/lib/mm/mm-1.4.2.tar.gz
49 export RUN_MM_CORE_APIS
=0
50 export LIBMM_INSTALLED
=0
51 ## This is required if already not set to /usr/local/lib/ as
52 ## mm-1.4.2.tar.gz gets installed at /usr/local/lib/
53 export LD_LIBRARY_PATH
=$LD_LIBRARY_PATH:/usr
/local
/lib
/:/lib
/
54 export PATH
=$PATH:/sbin
/
56 ## Set this to 1 if libaio-0.3.92.tar.gz is already installed in your system
57 ## from http://www.kernel.org/pub/linux/kernel/people/bcrl/aio/libaio-0.3.92.tar.gz
59 export LIBAIO_INSTALLED
=0
61 ## Set this to 1 if libcaps-2.11 or newer is already installed in your system
62 ## from ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/libcap2, as well as,
63 ## the libattr is available in the system. The kernel should also have been built
64 ## with the following option: CONFIG_SECURITY_FILE_CAPABILITIES=y
66 export LIBCAPS_INSTALLED
=0
67 export LIBATTR_INSTALLED
=0
69 ## Set this to 1 if you wish to execute the stress_cd tests
70 ## Make sure you have FLOPPY inserted, be warned that you
71 ## will loose all data on it after the tests,
72 export RUN_STRESS_FLOPPY
=0
74 ## Set this to 1 if you wish to execute the stress_floppy tests
75 ## Make sure you have CD inserted in your CD-ROM drive,
76 export RUN_STRESS_CD
=0
78 ##Set this to 1 if you wish to run the CPUHOTPLUG tests
79 export RUN_CPU_HOTPLUG
=0
81 ##Set this to 1 if you wish to run the LTP-NETWORK tests. Please refer to:
82 ## http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/network/LTP-Network-test_README.pdf
83 ## for more information on how to run the tests.
84 export RUN_LTP_NETWORK_TESTS
=0
86 ##Set this to 1 if you wish to run the LTP-NETWORK-STRESS tests. Please refer to:
87 ## http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/network/LTP-Network-test_README.pdf
88 ## and http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/network/stress/README
89 ## for more information on how to run the NETWORK-STRESS tests.
90 export RUN_LTP_NETWORK_STRESS_TESTS
=0
92 ## Set this to 1 if you wish to run the ltp/testscripts/adp tests
93 export RUN_LTP_ADP_TESTS
=0
95 ## Set this to 1 if you wish to run the AUTOFS tests
97 # 1) System with a floppy device with a floppy disk in it.
98 # 2) A spare (scratch) disk partition of 100MB or larger.
99 export RUN_LTP_AUTOFS1_TESTS
=0
100 export RUN_LTP_AUTOFS4_TESTS
=0
101 export DISK_PARTITION1
=0
103 ## Set this to 1 if you wish to run the EXPORTFS tests
104 # DESCRIPTION : A script that will test exportfs on Linux system.
106 # 1) NFS Server system with rsh enabled between client & server.
107 # 2) 100MB Disk partition on NFS server.
108 export RUN_EXPORTFS_TESTS
=0
109 export NFS_SERVER1
=xxx
110 export NFS_SERVER_DISK_PARTITION1
=yyy
111 export NFS_SERVER_FS_TYPE1
=zzz
114 ## Set this to 1 if you wish to run the FS tests on READ ONLY File Systems. Refer to http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testscripts/Readme_ROBind for more info
115 export RUN_RO_ONLY_FS_TESTS
=0
116 export READ_ONLY_DIRECTORY1
=xxxx
118 ## Set this to 1 if you wish to run the ISOFS tests
120 # Must have root access to execute this script
121 export RUN_ISOFS_TESTS
=0
123 ## Set this to 1 if you wish to run the DMMAPPER tests
124 #Note: In order to run this test, you must turn on "device mapper"
125 # component in kernel (it is under device drivers item when you
126 # run make menuconfig); and you must install userspace supporting
127 # files (libdevmapper and dmsetup). They are in the device-mapper
128 # package. You can download it from http://www.sistina.com. Follow
129 # the README/INSTALL file within the package to install it.
130 export RUN_DMMAPPER_TESTS
=0
131 export DISK_PARTITION2
=xxxxx
132 export DISK_PARTITION3
=yyyyy
134 ## Set this to 1 if you wish to run the FSLVM tests
135 #Note: fdisk needs to be run and the 4 HD partitions marked as 0x8e -- Linux LVM
136 # - If this is run on a 2.4 kernel system then LVM must be configured and the kernel rebuilt. In a 2.5 environment
137 # you must configure Device Mapper and install LVM2 from www.systina.com for the testcase to run correctly.
138 # - These operations are destructive so do NOT point the tests to partitions where the data shouldn't be overwritten.
139 # Once these tests are started all data in the partitions you point to will be destroyed.
140 export RUN_FSLVM_TESTS
=0
141 export DISK_PARTITION4
=xxxxxx
142 export DISK_PARTITION5
=yyyyyy
143 export DISK_PARTITION6
=zzzzzz
144 export DISK_PARTITION7
=iiiiii
145 export NFS_PARTITION1
=jjjjjj
147 ## Set this to 1 if you wish to run the FSNOLVM tests
148 #Note: fdisk needs to be run and the 4 HD partitions marked as 0x8e -- Linux LVM
149 # - If this is run on a 2.4 kernel system then LVM must be configured and the kernel rebuilt. In a 2.5 environment
150 # you must configure Device Mapper and install LVM2 from www.systina.com for the testcase to run correctly.
151 # - These operations are destructive so do NOT point the tests to partitions where the data shouldn't be overwritten.
152 # Once these tests are started all data in the partitions you point to will be destroyed.
153 export RUN_FSNOLVM_TESTS
=0
155 ## Set this to 1 if you wish to run the LTP SCSI DEBUG tests
156 #Note: Build scsi_debug as a module first before running the test
157 export RUN_LTP_SCSI_DEBUG_TEST
=0
159 ## Set this to 1 if you wish to run the LTP SYSFS tests
160 #Note: Must have root access to execute this script.
161 # USAGE : sysfs.sh [ -k <kernel_module> ]
162 # DESCRIPTION : A script that will test sysfs on Linux system.
163 # REQUIREMENTS: CONFIG_DUMMY must have been used to build kernel, and the
164 # dummy network module must exist.
165 export RUN_LTP_SYSFS_TEST
=0
166 export KERNEL_MODULE1
=xxxxxxx
168 ## Set this to 1 if you wish to run the LTP TIRPC tests
169 export RUN_LTP_TIRPC_TEST
=0
171 ##Set this to 1 if you wish to run the SE-Linux tests
172 # These testcases test the SELinux Security Module.
173 # A kernel with SELinux configured, and SELinux policy and userspace
174 # tools installed, are required to build and run the SELinux testsuite.
175 # Also, /usr/sbin should be included in PATH to ensure SELinux utilities
176 # such as getenforce are found. The test_selinux.sh script adds /usr/sbin
178 # You must also have the line:
180 # in your /etc/selinux/semanage.conf file as the test policy will violate some
181 # of the neverallow rules in the base policy. This line may already be present
182 # depending on your distribution; if not, add it before running the test suite
183 # and remove it when done. For more info, please refer to:
184 # http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/security/selinux-testsuite/README
185 export RUN_SE_LINUX_TESTS
=0
187 ##Set this to 1 if you wish to run the dma_thread_diotest7 test
188 export RUN_DMA_THREAD_DIOTEST7
=0
190 ##Set this to 1 if you wish to run the Controller area network (CAN)
191 ##protocol support tests. You would also like to review the Kernel
192 ##config options need to be set for this at ltp/README
193 export RUN_CONTROLLER_AREA_NETWORK_TESTS
=0
195 ##Set this to 1 if you wish to run the SMACK Security tests
196 ## Remember that you cannot run both the SELINUX and SMACK tests at a time,
197 ## as both of them cannot be tested in the same running kernel
198 export RUN_SMACK_SECURITY_TESTS
=0
200 ##Set this to 1 if you wish to run the Basic PERFORMANCE COUNTER tests
201 export RUN_PERFORMANCE_COUNTERS_TESTS
=0
203 export LTP_VERSION
=`./runltp -e`
204 export TEST_START_TIME
=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"`
205 export HARDWARE_TYPE
=$
(uname
-i)
206 export HOSTNAME
=$
(uname
-n)
207 export KERNEL_VERSION
=$
(uname
-r)
208 export HTML_OUTPUT_FILE_NAME
=$LTP_VERSION_$HOSTNAME_$KERNEL_VERSION_$HARDWARE_TYPE_$TEST_START_TIME.html
211 ## The First one i plan to run is the default LTP run ##
212 ## START => Test Series 1 ##
213 echo "Running Default LTP..."
214 .
/runltp
-g $HTML_OUTPUT_FILE_NAME
215 echo "Completed running Default LTP"
218 ## END => Test Series 1 ##
220 ## The next one i plan to run is ballista ##
221 ## START => Test Series 2 ##
222 if [ $RUN_BALLISTA -eq 1 ]
224 echo "Running Ballista..."
225 export TEST_START_TIME
=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"`
226 .
/runltp
-f ballista
-o $LTP_VERSION-BALLISTA_RUN_ON-$HOSTNAME-$KERNEL_VERSION-$HARDWARE_TYPE-$TEST_START_TIME.out
227 echo "Completed running Ballista"; echo; echo
229 ## END => Test Series 2 ##
231 ## The next one i plan to run is open_posix_testsuite ##
232 ## START => Test Series 3 ##
233 if [ $RUN_OPENPOSIX -eq 1 ]
235 echo "Running Open Posix Tests..."
236 (cd testcases
/open_posix_testsuite
; make)
237 echo "Completed running Open Posix Tests"; echo; echo
239 ## END => Test Series 3 ##
242 ## The next one i plan to run is ##
243 ## ltp/testcases/kernel/mem/libmm/mm_core_apis ##
244 ## START => Test Series 4 ##
245 if [ $RUN_MM_CORE_APIS -eq 1 ]
247 echo "Initializing ltp/testcases/kernel/mem/libmm/mm_core_apis ..."
248 # Check to see if User is Root
249 if [ $
(id
-u) -ne 0 ]
251 echo You need to be root to Install libmm and run mem
/libmm
/mm_core_apis
252 echo Aborting ltp
/testcases
/kernel
/mem
/libmm
/mm_core_apis
254 if [ $LIBMM_INSTALLED -ne 1 ]
256 echo Installing libmm-1.4
.2 .............
258 wget
-c ftp://ftp.ossp.org
/pkg
/lib
/mm
/mm-1.4
.2.
tar.gz
; \
259 tar -xzf mm-1.4
.2.
tar.gz
; \
261 .
/configure
&& make && make install )
262 rm -rf /tmp
/mm-1.4
.2*
263 echo libmm-1.4
.2 Installed .............
265 echo libmm-1.4
.2 already installed
in your system
267 echo "Running ltp/testcases/kernel/mem/libmm/mm_core_apis ..."
268 (cd testcases
/kernel
/mem
/libmm
; \
271 $LTPROOT/testcases
/bin
/mm_core_apis
; )
273 echo "Completed running ltp/testcases/kernel/mem/libmm/mm_core_apis..."; echo; echo
275 ## END => Test Series 4 ##
278 ## The next one i plan to run is ##
279 ## ltp/testcases/kernel/io/aio ##
280 ## START => Test Series 5 ##
281 if [ $RUN_AIOTESTS -eq 1 ]
283 echo "Initializing ltp/testcases/kernel/io/aio ..."
284 # Check to see if User is Root
285 if [ $
(id
-u) -ne 0 ]
287 echo You need to be root to Install libaio-0.3
.92 and run ltp
/testcases
/kernel
/io
/aio
288 echo Aborting ltp
/testcases
/kernel
/io
/aio
290 if [ $LIBAIO_INSTALLED -ne 1 ]
292 echo Installing libaio-0.3
.92.............
294 wget
-c http
://www.kernel.org
/pub
/linux
/kernel
/people
/bcrl
/aio
/libaio-0.3
.92.
tar.gz
; \
295 tar -xzf libaio-0.3
.92.
tar.gz
; \
297 make > /dev
/null
&& make install > /dev
/null
)
298 rm -rf /tmp
/libaio-0.3
.92*
299 echo libaio-0.3
.92 Installed .............
301 echo libaio-0.3
.92 already installed
in your system
303 echo "Building & Running ltp/testcases/kernel/io/aio..."
304 (cd testcases
/kernel
/io
/aio
; \
307 .
/aio02
/runfstests.sh
-a aio02
/cases
/aio_tio
; \
308 make clean
1>&2 > /dev
/null
)
309 echo "Completed running ltp/testcases/kernel/io/aio..."; echo; echo
312 ## END => Test Series 5 ##
316 ## The next one i plan to run is ##
317 ## ltp/testcases/kernel/security/filecaps ##
318 ## START => Test Series 6 ##
319 if [ $RUN_FILECAPS -eq 1 ]
321 echo "Initializing ltp/testcases/kernel/security/filecaps ..."
322 # Check to see if User is Root
323 if [ $
(id
-u) -ne 0 ]
325 echo You need to be root to Install libcaps and run ltp
/testcases
/kernel
/security
/filecaps
326 echo Aborting ltp
/testcases
/kernel
/security
/filecaps
328 if [ $LIBCAPS_INSTALLED -ne 1 ]
330 echo Installing libcaps.............
332 wget
-c ftp://ftp.kernel.org
/pub
/linux
/libs
/security
/linux-privs
/libcap
2/libcap-2.14.
tar.gz
; \
333 tar -xzf libcap-2.14.
tar.gz
; \
335 make > /dev
/null
&& make install > /dev
/null
)
336 rm -rf /tmp
/libcap-2.14
*
337 echo libcaps Installed .............
339 echo libcaps already installed
in your system
341 echo "Building & Running ltp/testcases/kernel/security/filecaps"
342 (cd ltp
/testcases
/kernel
/security
/filecaps
; \
343 make && make install > /dev
/null
; )
345 echo "Completed running ltp/testcases/kernel/io/aio..."; echo; echo
348 ## END => Test Series 6 ##
351 ## The next one i plan to run is tpm_tools ##
352 ## START => Test Series 7 ##
353 .
/runltp
-f tpm_tools
354 ## END => Test Series 7 ##
356 ## The next one i plan to run is tcore_patch_test_suites
357 ## START => Test Series 8 ##
359 ## END => Test Series 8 ##
362 ## The next one i plan to run is stress_cd tests
363 ## START => Test Series 9 ##
364 if [ $RUN_STRESS_CD -eq 1 ]
368 ## END => Test Series 9 ##
370 ## The next one i plan to run is stress_floppy tests
371 ## START => Test Series 10 ##
372 if [ $RUN_STRESS_FLOPPY -eq 1 ]
374 .
/runltp
-f io_floppy
376 ## END => Test Series 10 ##
378 ## The next one i plan to run is CPUHOTPLUG tests
379 ## START => Test Series 11 ##
380 if [ $RUN_CPU_HOTPLUG -eq 1 ]
382 .
/runltp
-f cpuhotplug
384 ## END => Test Series 11 ##
386 ## The next one i plan to run are the LTP Network tests
387 ## START => Test Series 12 ##
388 if [ $RUN_LTP_NETWORK_TESTS -eq 1 ]
390 (cd $LTPROOT/testscripts
/; .
/networktests.sh
)
392 ## END => Test Series 12 ##
394 ## The next one i plan to run are the LTP Network Stress tests
395 ## START => Test Series 13 ##
396 if [ $RUN_LTP_NETWORK_STRESS_TESTS -eq 1 ]
398 (cd $LTPROOT/testscripts
/; .
/networkstress.sh
)
400 ## END => Test Series 13 ##
403 ## The next one i plan to run are the LTP ADP tests
404 ## START => Test Series 14 ##
405 if [ $RUN_LTP_ADP_TESTS -eq 1 ]
407 (cd $LTPROOT/testscripts
/; .
/adp.sh
-d 3 -n 100)
409 ## END => Test Series 14 ##
412 ## The next one i plan to run are the LTP AUTOFS tests
413 ## START => Test Series 15 ##
414 if [ $RUN_LTP_AUTOFS1_TESTS -eq 1 ]
416 if [ $DISK_PARTITION1 ]
418 (cd $LTPROOT/testscripts
/; .
/autofs1.sh
$DISK_PARTITION1)
420 echo Disk Partition not
set. Aborting running AUTOFS1
423 if [ $RUN_LTP_AUTOFS4_TESTS -eq 1 ]
425 if [ $DISK_PARTITION1 ]
427 (cd $LTPROOT/testscripts
/; .
/autofs4.sh
$DISK_PARTITION1)
429 echo Disk Partition not
set. Aborting running AUTOFS4
432 ## END => Test Series 15 ##
435 ## The next one i plan to run are the LTP EXPORTFS tests
436 ## START => Test Series 16 ##
437 if [ $RUN_EXPORTFS_TESTS -eq 1 ]
439 (cd $LTPROOT/testscripts
/; .
/exportfs.sh
-h $NFS_SERVER1 -d $NFS_SERVER_DISK_PARTITION1 -t $NFS_SERVER_FS_TYPE1)
441 ## END => Test Series 16 ##
444 ## The next one i plan to run the FS tests on READ ONLY File Systems
445 ## START => Test Series 17 ##
446 if [ $RUN_RO_ONLY_FS_TESTS -eq 1 ]
448 (cd $READ_ONLY_DIRECTORY1; sh
$LTPROOT/testscripts
/test_robind.sh
)
450 ## END => Test Series 17 ##
453 ## The next one i plan to run the ISOFS tests
454 ## START => Test Series 18 ##
455 if [ $RUN_ISOFS_TESTS -eq 1 ]
457 (cd $LTPROOT/testscripts
/; .
/isofs.sh
)
459 ## END => Test Series 18 ##
462 ## The next one i plan to run the DMMAPPER tests
463 ## START => Test Series 19 ##
464 if [ $RUN_DMMAPPER_TESTS -eq 1 ]
466 (cd $LTPROOT/testscripts
/; .
/ltpdmmapper.sh
-a $DISK_PARTITION2 -b $DISK_PARTITION3)
468 ## END => Test Series 19 ##
471 ## The next one i plan to run the FSLVM tests
472 ## START => Test Series 20 ##
473 if [ $RUN_FSLVM_TESTS -eq 1 ]
475 (cd $LTPROOT/testscripts
/; .
/ltpfslvm.sh
-a $DISK_PARTITION4 -b $DISK_PARTITION5 -c $DISK_PARTITION6 -d $DISK_PARTITION7 -n $NFS_PARTITION1)
477 ## END => Test Series 20 ##
480 ## The next one i plan to run the FSNOLVM tests
481 ## START => Test Series 21 ##
482 if [ $RUN_FSNOLVM_TESTS -eq 1 ]
484 (cd $LTPROOT/testscripts
/; .
/ltpfsnolvm.sh
-a $DISK_PARTITION4 -b $DISK_PARTITION5 -c $DISK_PARTITION6 -d $DISK_PARTITION7 -n $NFS_PARTITION1)
486 ## END => Test Series 21 ##
488 ## The next one i plan to run the LTP SCSI DEBUG tests
489 ## START => Test Series 22 ##
490 if [ $RUN_LTP_SCSI_DEBUG_TEST -eq 1 ]
492 (cd $LTPROOT/testscripts
/; .
/ltp-scsi_debug.sh
)
494 ## END => Test Series 22 ##
496 ## The next one i plan to run the LTP SYSFS tests
497 ## START => Test Series 23 ##
498 if [ $RUN_LTP_SYSFS_TEST -eq 1 ]
500 (cd $LTPROOT/testscripts
/; .
/sysfs.sh
-k $KERNEL_MODULE1)
502 ## END => Test Series 23 ##
504 ## The next one i plan to run the LTP TIRPC tests
505 ## START => Test Series 24 ##
506 if [ $RUN_LTP_TIRPC_TEST -eq 1 ]
510 ## END => Test Series 24 ##
512 ## The next one i plan to run the LTP SE-Linux tests
513 ## START => Test Series 25 ##
514 if [ $RUN_SE_LINUX_TESTS -eq 1 ]
516 (cd $LTPROOT/testcases
/kernel
/security
/selinux-testsuite
; make && make install)
517 (cd $LTPROOT/testscripts
/; .
/test_selinux.sh
)
519 ## END => Test Series 25 ##
521 ## The next one i plan to run the DMA_THREAD_DIOTEST7 tests
522 ## START => Test Series 26 ##
523 if [ $RUN_DMA_THREAD_DIOTEST7 -eq 1 ]
525 .
/runltp
-f test_dma_thread_diotest7
527 ## END => Test Series 26 ##
529 ## The next one i plan to run the Controller area network
530 ## (CAN) protocol support tests
531 ## START => Test Series 27 ##
532 if [ $RUN_CONTROLLER_AREA_NETWORK_TESTS -eq 1 ]
536 ## END => Test Series 27 ##
538 ## The next one i plan to run the SMACK SECURITY tests
539 ## START => Test Series 28 ##
540 if [ $RUN_SMACK_SECURITY_TESTS -eq 1 ]
544 ## END => Test Series 28 ##
546 ## The next one i plan to run the PERFORMANCE COUNTERS tests
547 ## START => Test Series 29 ##
548 if [ $RUN_PERFORMANCE_COUNTERS_TESTS -eq 1 ]
550 (cd $LTPROOT/testcases
/kernel
/performance_counters
; make && make install)
551 .
/runltp
-f perfcounters
553 ## END => Test Series 29 ##