2. Agenda
Introduction
Build & Run LTP
Build & Run
Define Your Own Test Set
My Previous Work
How to Involve
LTP Introduction 2/14
3. What is LTP
Linux Test Project
Test Suite
Validate reliability, robustness, and stability of Linux
Automated, semi-automated tests
Testing Linux kernel and related features
Dominant: ANSI-C (94%), Bash (5%), Perl (0.62%)
Highlight cases;
testcases/open posix testsuite (mqueue, semaphore,
threads, timer);
testcases/kernel/: fs, syscalls, mm, etc;
testcases/network: nfs, rpc, sctp, etc;
testcases/mce-test;
testcases/numa;
tools/pounder30 (IBM testsuite)
LTP Introduction 3/14
4. Get LTP
Tar ball: http://sourceforge.net/projects/ltp/files/
git tree: https://github.com/linux-test-project/ltp.git
LTP Introduction 4/14
5. Structure
testcases/: source codes of all test cases
commands
kdump
mce-test
misc
crash
math
kernel
connectors
containers
controllers
syscalls,mm,fs,io,ipc,pty,sched,etc
network, etc
runtest/: command files used by ltp-pan to run tests
testscripts/: scripts that execute certain test sets
runltp, ltp-pan: driver script to run tests
runalltests.sh, runltplite.sh: run all/subset of ltp tests
LTP Introduction 5/14
6. Build & Run LTP
Build: ./configure && make && make install
Get LTP built and installed before running;
Default target dir: /opt/ltp;
To build a git version, run “make autotools” first.
Run: $LTPROOT/runltp
-f: list of test cases (separated with “,”), which may be
command files under “runtest/”, or
user-defined command files.
-p: human readable logfiles
-d: dir to put temp files
-l: logfile of test results
-o: test output
Run: $LTPROOT/runalltests.sh
No param
Default log location: $LTPROOT/output/, $LTPROOT/results
Run: $LTPROOT/runltplite.sh: similar arguments to ‘runltp’
(without -f option)
LTP Introduction 6/14
7. Define Your Own Test Set
new file under /path/to/ltp/runtest/, e.g.: my-tests
copy testcases items to the file my-tests, e.g:
oom01 oom01
run your own tests with command /path/to/ltp/runltp -f
my-tests
LTP Introduction 7/14
8. My Previous Work
Fix bugs under testcases/kernel/*
Compose New cases against mm sub-system, including
NUMA, oom, cgroup, etc.
Review and ACK patches from LTP community.
LTP Introduction 8/14
9. How to Involve - Help to Debug
Target: pass all tests
Collect reproducing steps, circumstance, error log (run log,
result log)
strace, gdb, printf/echo, set -x, etc. . .
LTP Introduction 9/14
10. How to Involve - Submit Patch
Submit patch to upstream:
Use git;
check your patch format with checkpatch.pl tool from
Kernel source;
Send your patch to ltp-list@lists.sourceforge.net
LTP Introduction 10/14
11. How to Involve - Write New Testcase
New case under $LTPROOT/testcases/ and new commands
under $LTPROOT/runtest/
Necessary comments and description
Formats (code style, breaking-line, short description,
pre-defined functions, etc)
Let everyone uderstand why you add this testcase.
LTP Introduction 11/14