1 Linux Test Project 2 ================== 3 4 Linux Test Project is a joint project started by SGI, OSDL and Bull developed 5 and maintained by IBM, Cisco, Fujitsu, SUSE, Red Hat, Oracle and others. The 6 project goal is to deliver tests to the open source community that validate the 7 reliability, robustness, and stability of Linux. 8 9 The LTP testsuite contains a collection of tools for testing the Linux kernel 10 and related features. Our goal is to improve the Linux kernel and system 11 libraries by bringing test automation to the testing effort. Interested open 12 source contributors are encouraged to join. 13 14 Project pages are located at: http://linux-test-project.github.io/ 15 16 The latest image is always available at: 17 https://github.com/linux-test-project/ltp/releases 18 19 The discussion about the project happens at ltp mailing list: 20 http://lists.linux.it/listinfo/ltp 21 22 The git repository is located at GitHub at: 23 https://github.com/linux-test-project/ltp 24 25 The patchwork instance is at: 26 https://patchwork.ozlabs.org/project/ltp/list/ 27 28 Warning! 29 ======== 30 31 **Be careful with these tests!** 32 33 Don't run them on production systems. Growfiles, doio, and iogen in particular 34 stress the I/O capabilities of systems and while they should not cause problems 35 on properly functioning systems, they are intended to find (or cause) problems. 36 37 Quick guide to running the tests 38 ================================ 39 40 If you have git, autoconf, automake, m4, the linux headers and the common 41 developer packages installed, the chances are the following will work. 42 43 ``` 44 $ git clone https://github.com/linux-test-project/ltp.git 45 $ cd ltp 46 $ make autotools 47 $ ./configure 48 ``` 49 50 Now you can continue either with compiling and running a single test or with 51 compiling and installing the whole testsuite. 52 53 Shortcut to running a single test 54 --------------------------------- 55 56 If you need to execute a single test you actually does not need to compile 57 whole LTP, if you want to run a syscall testcase following should work. 58 59 ``` 60 $ cd testcases/kernel/syscalls/foo 61 $ make 62 $ PATH=$PATH:$PWD ./foo01 63 ``` 64 65 Shell testcases are a bit more complicated since these need a path to a shell 66 library as well as to compiled binary helpers, but generally following should 67 work. 68 69 ``` 70 $ cd testcases/lib 71 $ make 72 $ cd ../commands/foo 73 $ PATH=$PATH:$PWD:$PWD/../../lib/ ./foo01.sh 74 ``` 75 76 Open Posix Testsuite has it's own build system which needs Makefiles to be 77 generated first, then compilation should work in subdirectories as well. 78 79 ``` 80 $ cd testcases/open_posix_testsuite/ 81 $ make generate-makefiles 82 $ cd conformance/interfaces/foo 83 $ make 84 $ ./foo_1-1.run-test 85 ``` 86 87 Compiling and installing all testcases 88 -------------------------------------- 89 90 ``` 91 $ make 92 $ make install 93 ``` 94 95 This will install LTP to `/opt/ltp`. 96 * If you have a problem see `doc/mini-howto-building-ltp-from-git.txt`. 97 * If you still have a problem see `INSTALL` and `./configure --help`. 98 * Failing that, ask for help on the mailing list or Github. 99 100 Some tests will be disabled if the configure script can not find their build 101 dependencies. 102 103 * If a test returns `TCONF` due to a missing component, check the `./configure` 104 output. 105 * If a tests fails due to a missing user or group, see the Quick Start section 106 of `INSTALL`. 107 108 To run all the test suites 109 110 ``` 111 $ cd /opt/ltp 112 $ ./runltp 113 ``` 114 115 Note that many test cases have to be executed as root. 116 117 To run a particular test suite 118 119 ``` 120 $ ./runltp -f syscalls 121 ``` 122 123 To run all tests with `madvise` in the name 124 125 ``` 126 $ ./runltp -f syscalls -s madvise 127 ``` 128 Also see 129 130 ``` 131 $ ./runltp --help 132 ``` 133 134 Test suites (e.g. syscalls) are defined in the runtest directory. Each file 135 contains a list of test cases in a simple format, see doc/ltp-run-files.txt. 136 137 Each test case has its own executable or script, these can be executed 138 directly 139 140 ``` 141 $ testcases/bin/abort01 142 ``` 143 144 Some have arguments 145 146 ``` 147 $ testcases/bin/fork13 -i 37 148 ``` 149 150 The vast majority of test cases accept the -h (help) switch 151 152 ``` 153 $ testcases/bin/ioctl01 -h 154 ``` 155 156 Many require certain environment variables to be set 157 158 ``` 159 $ LTPROOT=/opt/ltp PATH="$PATH:$LTPROOT/testcases/bin" testcases/bin/wc01.sh 160 ``` 161 162 Most commonly, the path variable needs to be set and also `LTPROOT`, but there 163 are a number of other variables, `runltp` usually sets these for you. 164 165 Note that all shell scripts need the `PATH` to be set. However this is not 166 limited to shell scripts, many C based tests need environment variables as 167 well. 168 169 Developers corner 170 ================= 171 172 Before you start you should read following documents: 173 174 * `doc/test-writing-guidelines.txt` 175 * `doc/build-system-guide.txt` 176 177 There is also a step-by-step tutorial: 178 179 * `doc/c-test-tutorial-simple.txt` 180 181 If something is not covered there don't hesitate to ask on the LTP mailing 182 list. Also note that these documents are available online at: 183 184 * https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines 185 * https://github.com/linux-test-project/ltp/wiki/BuildSystem 186 * https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial 187 188 Although we accept GitHub pull requests, the preferred way is sending patches to our mailing list. 189