The Linux Test Project has not yet decided on a "final" test harness. We have provided a simple solution with pan to make due until a complete solution has been found/created that compliments the Linux kernel development process. Several people have said we should use such and such a test harness. Until we find we need a large complex test harness, we will apply the KISS concept.
pan is a simple test driver. It will take a list of test tags and command lines and run them. pan has the ability to run the test sequentially or randomly and in parallel while capturing test output and cleaning up orphaned processes. pan can also be nested to create very complex test environments.
A pan file contains a list of tests to run. The format of a pan file is as follows:
testtag testprogram -o one -p two other command line options # This is a comment. It is a good idea to describe the test # tags in your pan file. Tests programs can have different # behaviors depending on the command line options so it is # helpful to describe what each test tag is meant to verify or # provoke. # Some more test cases mm01 mmap001 -m 10000 # 40 Mb mmap() test. # Creates a 10000 page mmap, touches all of the map, sync's # it, and munmap()s it. mm03 mmap001 -i 0 -I 1 -m 100 # repetitive mmapping test. # Creates a one page map repetitively for one minute. dup02 dup02 # Negative test for dup(2) with bad fd kill09 kill09 # Basic test for kill(2) fs-suite01 pan -e -a fs-suite01.zoo -n fs-suite01 -f runtest/fs # run the entire set of file system tests |
For more information on pan see the man page doc/man1/pan.1.
scanner is a results analysis tool that understands the rts style output which pan generates by default. It will produce a table summarizing which tests passed and which failed.
Many of the tests released use the Quick-hitter test package to perform tasks like create and move to a temporary directory, handle some common command line parameters, loop, run in parallel, handle signals, and clean up.
There is an example test case, doc/examples/quickhit.c, which shows how the quick-hitter package can be used. The file is meant to be a supplement to the documentation, not a working test case. Use any of the tests in tests/ as a template.