LTP Filesystem Test Suites
A deep-dive analysis of how the Linux Test Project tests filesystems — suites, mechanics, and how to run them with kirk on xfs/ext4/btrfs/f2fs.
Based on an analysis of the LTP source tree (
linux-test-project/ltp): every filesystem-related test suite intestcases/kernel/fs/, the relatedruntest/fs*scenario files, the filesystem-oriented syscall tests, and the shared test infrastructure they rely on. Test executor: kirk (runltp is removed).
1. Overview
The Linux Test Project (LTP) is a collection of tools and tests that validate the reliability, robustness and stability of the Linux kernel. The tree is organized as:
| Path | Purpose |
|---|---|
testcases/kernel/fs/ | Dedicated filesystem test suites (stress, integrity, mount, permissions, ACL, per-fs) — the main focus of this document |
testcases/kernel/syscalls/ | ~387 syscall test directories, of which ~60 directories / ~360 .c files test filesystem syscalls (open, read, write, rename, stat, fsync, xattr, inotify, quotactl, …) |
testcases/kernel/fs/fs_bind/ | Bind-mount / mount-namespace semantics tests |
testcases/kernel/fs/fs_readonly/ | Read-only bind-mount wrapper tests |
runtest/ | Scenario files (command lists) that map test tags → commands; relevant: fs, fs_bind, fs_readonly, fs_perms_simple, ltp-aio-stress, ltp-aiodio.part1–4 |
lib/, include/ | Shared test API (tst_test.h, tst_fill_fs.c, tst_device.c, tst_supported_fs_types.c, …) and helpers |
tools/kirk/ | kirk — the official LTP test executor (successor of the removed runltp/ltp-pan); reads the runtest/ scenario files, supports parallel execution and remote testing via SSH/Qemu/LTX |
How LTP tests work in general:
- The runner is kirk (a fork of runltp-ng, installed as
kirkonPATH//opt/ltp/kirk). It reads theruntest/<scenario>files where each line isTAG command...; each line becomes one “test” whose result (pass/fail/broken/skip) kirk derives from the test’s exit code and output. The legacyrunltpscript has been removed from LTP — running it now just prints “runltp was removed from LTP use kirk instead”. See §13 for how to drive these suites with kirk (selection, parallelism, timeouts, JSON reports, remote SUTs, custom scenario files). - Tests come in two generations:
- Old API — standalone C programs or shell scripts returning exit codes.
- New API (
tst_test.h) — the test registersstruct tst_testwithsetup(),run()(orrun_all()for auto-generated variants),cleanup()callbacks; the framework handles forking per test case, timeouts, tmpdir creation, result reporting (TPASS/TFAIL/TBROK/TCONF), and needs (TST_NEEDS_ROOT,TST_NEEDS_TMPDIR,TST_NEEDS_CMDS,.needs_device,.mount_device,.format_device, …).
- Shell tests use
testcases/lib/tst_test.shwith the same declarative style.
2. runtest/fs suite
runtest/fs (DESCRIPTION: “Filesystem stress tests”) wires together all the
classic suites. Major groups of entries:
| Tag group | Command | Suite |
|---|---|---|
gf01–gf30 | growfiles ... | file growth/shrink/IO stress (§3.1) |
rwtest01–rwtest05 | rwtest ... | read/write + mmap IO via iogen/doio (§3.2) |
iogen01 | rwtest -N iogen01 ... | raw `iogen |
fs_inod01 | fs_inod $TMPDIR 10 10 10 | inode alloc/dealloc stress (§4.4) |
linker01 | linktest.sh | link count stress (§4.6) |
openfile01 | openfile -f10 -t10 | many open handles on one file (§4.7) |
inode01, stream01–05, ftest01–08 | classic binary tests | §4.1, §4.2 |
lftest01, writetest01 | large-file / write test | §4.9 |
fs_di | fs_di -d $TMPDIR | data-integrity incl. fragmentation (§4.5) |
proc01 | proc01 -m 128 | read every file in /proc (§5.2) |
read_all_dev/proc/sys | `read_all -d /dev | /proc |
fs_racer | fs_racer.sh -t 5 | race-condition stress (§6) |
quota_remount_test01 | script | quota across remount (§8.2) |
isofs | isofs.sh | ISO9660 mount/usage (§9.1) |
fs_fill | fs_fill | fill filesystem to ENOSPC (§4.3) |
binfmt_misc01/02 | scripts | binfmt_misc registration (§9.3) |
squashfs01 | squashfs01 | squashfs lookup-table overflow regression (§9.2) |
acl_*01 | 6 binaries | POSIX ACL semantics (§10) |
Related scenario files:
runtest/fs_bind— 95 bind-mount/mount-namespace test tags (§7.1).runtest/fs_readonly— read-only bind-mount matrix, 54 tags (§7.2).runtest/fs_perms_simple— 18 permission-check cases (§4.8).runtest/ltp-aio-stress,ltp-aiodio.part1–4— async IO / direct-IO stress (aio-stress,aiodio_*), filesystem-adjacent.
3. SGI I/O core
These are the oldest and heaviest LTP I/O tools (Silicon Graphics, 2000). The LTP README explicitly warns they “stress the I/O capabilities of the systems and are intended to find (or cause) problems”.
3.1 growfiles
What it does: repeatedly grows and shrinks a set of files while verifying that every byte ever written still contains the expected pattern.
How it works (from the source’s own layout comment):
process cmdline -> print debug -> setup signal handlers
-> fork num_procs children (-n procs[:forker_mode])
-> malloc I/O buffer
Loop until stop:
check iteration / time / max-errors / bytes limits
for each file:
open file
fstat (detects FIFOs)
optionally preallocate space
grow file (append via write/pwrite/lseek modes)
check last write (re-read and pattern-verify the newest chunk)
check whole file (full-content verification pass)
optionally shrink file (ftruncate)
close file
optional delay
Key mechanics:
- Each file grows by
grow_incrbefore the same file grows twice; files are opened/closed sequentially so metadata paths (open, inode alloc, extent allocation) are hammered as much as data paths. - Write patterns are ASCII or binary (
-I ppattern,-I rrandom,-I l/Lalternating), and verification distinguishes “never written” (must be zero) from “written” (must match pattern) — the same philosophy asftest01. - Supports growing via
lseekinstead ofwrite(-w, i.e. hole/sparse creation), FIFOs as targets,-oopen-flag sets (e.g.O_RDWR,O_CREAT,O_TRUNC,O_SYNC), auto-generated file names (-N num_files,-f prefix), child process count (-n procs[:forker_mode]), write-check / file-check intervals (-C,-c), iteration count / time interval / max errors (-i,-L,-e), grow increment (-g), truncate increment/interval (-t,-T), random I/O sizes (-r min-max:align) and random seeks (-R), buffered max-bytes mode (-B), file locking (-l), unlink interval (-U), and remove-on-exit (-u).-Wonly sets the test-case tag name. - Data correctness helpers:
dataascii.c,databin.c,datapid.c(per-PID patterns so multiple children’s writes are distinguishable),pattern.c. write_log.cimplements an optional write journal: every operation is logged so that a crash mid-run can be replayed/checked (used byfsx-style debugging and byrwtest).
Why it finds bugs: interleaving growth, truncation, holes, sync writes and verification catches page-cache vs. disk inconsistencies, extent-map corruption, and fs repair bugs.
3.2 iogen + doio
iogen— an I/O request generator. It takes file specs (500b:file 1000b:file2) and emits randomly-generated I/O request records on stdout: random offset, length, syscall flavor (read,write,reada,writea,ssread/sswrite,listio,mmapvariants), flags (O_SYNC, O_DIRECT/O_RAW, etc.).doio— the request executor. Reads iogen records, performs the requested syscall, and verifies data patterns for reads (using the shared data-pattern libraries). It supports system-call and write logging, file-range locking (file_lock.c), and multiple processes (-n). On a verification mismatch it dumps the offending region details.rwtest— a shell front-end that: creates the file set, pipesiogenintodoio, manages duration (-i 60s/ iteration counts), strategy selection (-f sync|buffered), and optionallymmread,mmwritemmap-based access (-s,-m random), then cleans up.
The iogen01 scenario runs the raw pipeline
rwtest -i 120s -s read,write -Da -Dv -n 2 500b:f1 1000b:f2, i.e. two
concurrent doio children doing mixed buffered/sync read/write/mmap I/O with
full data verification (-Dv) for two minutes.
3.3 doio library
bytes_by_prefix.c (parses “1000b”/“4k”/“2m”), open_flags.c (string→open
flag masks), forker.c (supervised forking), string_to_tokens.c — shared by
all tools above.
4. Classic tests
4.1 ftest01-08
The “ftest” family was ported from SPIE (section2/filesuite, via IBM’s
Airong Zhang) and builds on the original rbk/dale programs. There are only
four distinct tests; the other four are their large-file (lseek64)
twins:
| Test | Behaviour |
|---|---|
| ftest01 | piece-wise file I/O. A bitmap records which pieces of the file were written. Each iteration picks a random piece: if never seen, it must read back as zeros (hole check), then a data pattern is written; if seen before, the pattern must match. Calls lseek, read, write, truncate, ftruncate, fsync, sync, fstat. |
| ftest02 | “inode things”: repeated open/close/read/write/lseek/unlink/chdir cycles creating and removing files and directories (-f dirname nchild iterations). |
| ftest03 | same bitmap-verified piece-wise I/O as ftest01, but using readv/writev scatter/gather I/O. |
| ftest04 | “single file I/O” (tsfio.c): several child processes do random lseek/read/write on the same file (fsync, sync). |
| ftest05 | identical to ftest01 with lseek64 (large-file offsets). |
| ftest06 | identical to ftest02 with lseek64. |
| ftest07 | identical to ftest03 with lseek64. |
| ftest08 | identical to ftest04 with lseek64. |
Shared helpers live in libftest.c. All use the old LTP reporting style and the
same invariant: written data must read back identical; never-written regions
must read as zero.
4.2 stream, inode01
stream01–05 are modern (new API) tests of stdio FILE* stream semantics,
not of pipes/STREAMS despite the directory name:
-
stream01 —
fopen/freada file into a buffer and compare the content read to the expected string (SAFE_FOPEN/SAFE_FREAD). -
stream02 —
fopen()of a FIFO (mknodS_IFIFO) with every mode (r,w,a,r+, …), checking eachfopensucceeds. -
stream03 — stream position semantics on an
a+stream:ftell,fseek(SEEK_SET/CUR/END),rewindreturn the expected offsets. -
stream04 —
fwritethen reopenr+/freadround-trip: bytes read back must equal the bytes written. -
stream05 — mixes buffered
FILE*writes with rawwrite(fd)on the same underlying descriptor,fflush+fsync, then verifies the readback content. -
inode01 — inode-number integrity under load (new API,
.all_filesystems). It runs two cases: a single process building one small directory tree (depth 3, fanout 4, 100 repetitions), and several workers (5) simultaneously building independent larger trees (depth 6, fanout 6), synchronised through a checkpoint. It records(inode, path)for every created file and verifies no two distinct files share an inode number (duplicates reported, up to 10 shown).
4.3 fs_fill (ENOSPC)
Modern tst_test.h test with two variants (tcnt = 2, one per fill access
pattern). setup() starts nthreads = tst_ncpus_conf() + 2 worker
pthreads; each worker loops calling tst_fill_fs() (library helper that
fills a filesystem with the given access pattern until ENOSPC), bumps an
atomic enospc_cnt, then walks its directory opening every file it finds.
testrun() stops when either ≥1 ENOSPC was seen after ≥1 s, or more than
100 ENOSPCs occurred, then reports TPASS with the count and runtime.
Regression class: filesystems deadlocking or misbehaving when 100% full.
Declared with .all_filesystems = 1, .dev_min_size = 1024 (1 GB),
.timeout = 300.
4.4 fs_inod
POSIX shell script (#!/bin/sh, originally an AIX JFS stress script):
fs_inod <dir> <numsubdirs> <numfiles> <numloops>. Spawns background
subshells that rapidly create and delete files in parallel subdirectories,
repeating for numloops. Catches inode leak / free-list corruption bugs.
fs_inod01 runs it as fs_inod $TMPDIR 10 10 10.
4.5 fs_di
Two phases:
- Create a data file (default 30 MB, or random size) via
create_datafile.c, copy it to a random directory depth on the target filesystem, thencmpthe two files — any difference is a data-integrity failure. Loops (default 10). - Fragmentation test (
frag.c): creates a file of ~half the partition, then builds two heavily fragmented files on the target partition (by interleaved allocation with holes) and copies the datafile into them; both fragmented copies are compared byte-for-byte with the original. This targets fragmented-read/write correctness in the block layer and fs.
4.6 linktest
Creates a configurable number of hard links (-a n, default 1000) to one
file and of symbolic links (-s n, default 1000) to another, verifying
every link()/symlink() call succeeds and the resulting names resolve.
It is a link-count/limit stress rather than an EMLINK boundary probe —
raise -a towards the filesystem’s s_link_max to probe the limit. Runs as
linker01 in the fs scenario (defaults).
4.7 openfile
Usage: openfile [-d] -f FILES -t THREADS (old API). Each of the THREADS
pthreads fopens the same file FILES times and holds all handles open
(the handles are per-thread FILE* arrays); one thread then performs the
read while the rest wait on a condition variable, exercising concurrent
open-file-description handling. Limits: MAXFILES 32768 per thread,
MAXTHREADS 10 (= up to ~327k simultaneously open handles). openfile01
runs openfile -f10 -t10 → 10 threads × 10 handles on one file.
4.8 fs_perms
A small C program driven by 7 command-line arguments:
fs_perms <file_mode> <file_uid> <file_gid> <test_uid> <test_gid> <r|w|x> <expected_result>.
Mechanics: creates a test file, chowns/chmods it to the specified owner,
group and mode; forks, drops to the test uid/gid (via setuid/setgid in
the child), then attempts the requested access (open for r/w, execl of a
shebang script for x); compares the actual outcome to the expected result.
The fs_perms_simple scenario runs 18 cases covering the complete
owner/group/other × read/write/execute matrix (see §2).
4.9 lftest/writetest
- lftest — large-file write test: writes
-n COUNTmegabytes (default 100, so 100 MB) tolarge_fileas 1 MB buffers,fsync+lseekafter each buffer, then reports elapsed time. Raising-n(e.g.lftest -n 5000= 5 GB) drives the kernel through 64-bit file offsets. The read-only scenarios call it aslftest -n 80. - writetest — writes a file of the specified size in chunks, closes it,
reopens and re-reads it, verifying the content; simple end-to-end buffered
write integrity check (lives under
kernel/io/, listed in thefsscenario aswritetest01).
4.10 fsstress
A port of the SGI XFS fsstress tool. Model:
- Maintains a set of named file pools (
ddirs,fregular files,llinks,cchar devices,rrt files) and picks operations weighted-randomly from an operation table. With LTP’s-DNO_XFSbuild the available ops are:chown,creat,dread,dwrite,fdatasync,fsync,getdents,link,mkdir,mknod,read,readlink,rename,rmdir,stat,symlink,sync,truncate,unlink,write. (XFS-only builds addallocsp/freesp/resvsp/unresvsp/attr_set/attr_remove/bulkstat.) - Frequencies are tunable with
-f op_name=freq(see-Sfor the table);-p nprocprocesses each perform-n nopsoperations,-l loopsrepeats the run,-s seedfixes the PRNG,-d dirchooses the base directory. - Random offsets/sizes exercise boundary conditions (EOF, holes, partial
blocks);
-vlogs every op asprocid/opno: op args;-ckeeps the files for post-mortem inspection.
This is the suite that historically found many XFS/ext* concurrency bugs.
Because it uses stat64/open64 compatibility shims (xfscompat.h), it
runs on any POSIX filesystem.
4.11 fsx-linux
Historically LTP carried Apple/NeXT’s fsx (File System eXerciser, Avadis Tevanian, 1991). The current file is a complete rewrite (2023, SUSE / Andrea Cervesato) on the new test API: it keeps the model-checking idea but is a much smaller, self-contained test.
Algorithm (run() in the source):
memset(file_buff, 0, file_max_size) # in-memory model
memset(temp_buff, 0, file_max_size) # scratch for comparisons
ftruncate(fd, 0)
while (counter < op_nums):
op = random() % OP_TOTAL # READ, WRITE, TRUNCATE, MAPREAD, MAPWRITE
offset/size = random position (optionally aligned to page/align factor)
perform the op on the real file (write / mmap+memcpy+msync / truncate / read)
for reads: compare the bytes read against the in-memory model
(memory_compare) -> mismatch means silent corruption
update the tracked file size
Every op returns the number of “operations consumed”; if the loop cannot
reach op_nums the test reports TFAIL (“Some file operations failed”),
otherwise TPASS.
Options (new API, fsx-linux -h): -l max test-file size (default
256 KB), -o max size of a single operation (default 64 KB), -N total
number of operations (default 1000), and -w/-r/-t alignment factors for
write/read/truncate offsets. The test works in its own tmpdir on a single
file ltp-file.bin, so there is no seed/ops-log/-P path argument in
this version (the old fsx journal-replay tool is gone).
Key properties:
- Model checking: correctness is defined as “file content equals the in-memory model”, not “syscall returned 0” — this catches silent corruption.
- Metadata ops included:
truncate, and mmapMAP_SHAREDwrite/read, so page-cache/msync interactions and EOF shrinking are exercised alongside plainread/write. - Randomised but bounded: fixed op count (
-N) and bounded file/op sizes keep a run reproducible enough for CI, whiletimeout = 1800bounds it.
For the historical, seed-driven fsx with an ops journal, use upstream
xfstests’ fsx instead — that tool is what most filesystem developers run;
the LTP version is the simplified in-tree rewrite.
4.12 fsplough/maim
- fsplough — repeatedly creates large files until the target filesystem is full, then deletes them, in a loop (a “plough” through free space); exercises allocation, ENOSPC handling, and free-space fragmentation.
- fs_maim/ (
maimparts,backbeat,partbeat) — older IBM-era partition-level stressors that “maim” partitions by heavy random I/O patterns; largely legacy, not wired into runtest scenarios.
5. read_all, proc01
5.1 read_all
Purpose: read every file under a directory tree — used on /proc,
/sys, /dev (read_all_proc, read_all_sys, read_all_dev scenarios).
How it works:
- One parent process recursively scans the directory tree and pushes file paths onto a queue in shared memory.
- Multiple worker processes (default: number of CPUs, capped at 15 to
avoid turning into an IPC test on many-core boxes;
-woverrides) pop paths and read each file fully. -r N= schedule every file for reading N times (the default is 1;runtest/fsuses-r 3), so transient unreadable pseudo-fs entries get re-read without failing the test.-q= don’t print per-file read/open errors;-v= also print successful reads;-d= root directory (default/sys);-e PATTERN= fnmatch blacklist;-w N= worker count limit (default 15);-W N= hard worker count override (ignores-wand CPU count);-p= drop privileges tonobody;-t ms= per-file worker timeout before the worker is restarted..runtime = 100caps the overall run;forks_childis set.- Failures are recorded per-path; known-good expected failures (per-file quirks listed in the source) are whitelisted.
Why: reading every /proc//sys file is a classic kernel-latency and
oops trigger — it touches nearly every driver’s ->show() callback. The header
notes it “does enough to disturb the kernel. A good kernel latency killer
too.”
5.2 proc01
The older, single-threaded predecessor of the same idea, specifically for
/proc: walks /proc recursively (-m 128 MB read limit per file), reads
every entry, flags entries that fail to open/read with an errno whitelist of
known-good failures (e.g. writing-only entries, per-arch quirks), and reports
unexpected failures. Also compiled with optional SELinux awareness
(HAVE_LIBSELINUX_DEVEL).
6. fs_racer
A shell-based race fuzzer: fs_racer.sh -t DURATION starts 24
background subprocesses — three copies each of eight operation scripts —
all working on the same directory for DURATION seconds (the -t value
is passed straight to sleep; runtest/fs uses -t 5), then killalls
them and removes the directory:
| Script | Operation loop |
|---|---|
fs_racer_file_create.sh | create/delete files of random names |
fs_racer_file_concat.sh | append to files being created/deleted |
fs_racer_file_list.sh | recursive ls -R while files churn |
fs_racer_file_rm.sh | delete files |
fs_racer_file_link.sh | create/remove hard links |
fs_racer_file_symlink.sh | create/remove symlinks |
fs_racer_file_rename.sh | rename files onto each other |
fs_racer_dir_create.sh | create/remove subdirectories |
(fs_racer_dir_test.sh ships in the directory but is not launched by
fs_racer.sh.)
Because the scripts run concurrently against the same namespace, they exercise dentry-cache, inode-refcount, and rename/unlink races that single-threaded tests miss. Result: the runner checks for kernel oopses/ hung scripts rather than data content.
7. Mount/namespaces
7.1 fs_bind
The largest filesystem test family in LTP: 94 test scripts exposed as
95 scenario tags, split into five groups, all built on the shared library
fs_bind_lib.sh:
bind/— plainmount --bindsemantics (fs_bind01–fs_bind24, plusfs_bind07-2) — 25 scripts.rbind/— recursive bind (mount --rbind) semantics (fs_bind_rbind01–39, plusrbind07-2) — 40 scripts.move/—mount --movesemantics (move01–move22) — 22 scripts.cloneNS/— mount propagation acrossunshare(CLONE_NEWNS)/ namespace cloning (cloneNS01–07) — 7 scripts.fs_bind_regression.sh— historical bug reproductions.
How the library works:
- Each test runs with
TST_NEEDS_ROOT,TST_NEEDS_TMPDIR, and requiresmount,umount,awk,sed. fs_bind_setupcreates a sandbox with 4 “disk” directories (sandbox/disk1..disk4) containing files.fs_bind_makedir <share_mode> <dir>: creates a directory and bind-mounts it to itself, then sets a propagation type:--make-{shared|private|rshared|slave|rslave|rprivate|runbindable}. (Bind-to-self + separate--make-*call is used because busyboxmountcan’t combine them in one command.)fs_bind_check [-n] [-s] dirA dirB ...— verifies that the given subtrees reflect the same propagation (content compared viafind/awk);-nasserts that no propagation happened,-sperforms the check inside the recorded mount namespace ($FS_BIND_MNTNS_PID).- Tests then perform sequences of
mount --bind,--rbind,--move,unshare, file creation, and umounts, asserting after each step which mounts did or did not see the change. Example (fs_bind01.sh): builds a shared groupshare2, bindsdisk1underparent1/child1, then bindsparent1/child1intoparent2/child2and verifies contents propagate toshare2/child2/a, etc. - Cleanup umounts everything; leftover mounts cause TBROK.
These tests encode the semantics documented in
Documentation/filesystems/sharedsubtree.rst — they are effectively the
executable specification of mount propagation.
7.2 test_robind
For each of three mount configurations of a big block device
($LTP_BIG_DEV, ≥500 MB; filesystem set by $LTP_BIG_DEV_FS_TYPE, default
an ext-family fs, but the script also documents ext3,ext2,jfs,xfs,reiserfs,ramfs):
- a) normal mount on
dir1, - b)
mount --bind dir2(writable bind), - c)
mount -o remount,ro(read-only bind,dir3-ro),
the script runs a configurable inner test command (-c "...") inside each
directory. In the writable mounts, the inner test must succeed; in the
ro-bind mount, any write attempt must fail (the script asserts
non-writability). The runtest/fs_readonly scenario reuses this to run
the entire classic suite (growfiles, rwtest, fs_inod, openfile, stream01–05,
ftest01–08, lftest, writetest — 54 tags) under ro-bind. This was
originally developed for container RO-bind testing (Veerendra/Dave Hansen,
2008).
7.3 mount syscalls
Under testcases/kernel/syscalls/: mount/, umount2/, open_tree/,
mount_setattr/, move_mount/, statmount/, openat2/ — each contains
several focused tests of the new mount API and classic mount syscalls
(e.g. openat2 RESOLVE_* flags, mount_setattr propagation/ro-idmapped
attributes, statmount query interface).
8. Quota/remount
8.1 quotactl
New-API tests of the quotactl(2) interface: Q_GETQUOTA/Q_SETQUOTA,
Q_GETNEXTQUOTA, Q_XGETQUOTA (XFS), quota on/off, and error paths
(EFAULT, EINVAL, ESRCH…), run against a loop-mounted ext4/vfat/xfs test
device provided by the framework (.needs_device, .format_device,
.mount_device, .dev_fs_type, .dev_min_size).
8.2 quota_remount
Regression test for a linux-2.6.26 behavior: creates an ext3 image with
mkfs.ext3 (dd’d file, 8000×4096 blocks), enables quotas
(/proc/sys/fs/quota must exist), mounts it, sets a quota, then
mount -o remount and verifies quota state survives remount.
9. Per-fs tests
9.1 isofs
Loop-mount ISO9660 functionality test: generates an ISO image with
genisoimage/mkisofs from a datafile tree (multiple sessions / Rock Ridge
/Joliet variants when tools available), mounts it via loop device, then
verifies: directory listing matches, files readable, permissions/owners
correct (where the ISO flavor supports them), long filenames and deep
directory nesting survive. Skips (TCONF) when mkisofs is missing.
9.2 squashfs01
Kernel regression test for squashfs lookup-table sanity-check bugs
(fixed by commits c1b2028315c “squashfs: fix inode lookup sanity checks”
and 8b44ca2b634 “fix xattr id and id lookup sanity checks”). Because a
squashfs inode-lookup block holds ≤8192 entries (8 B each uncompressed) and
id/xattr blocks are 4/16 B, the test crafts a filesystem containing 2048
files with unique uid/gid and xattrs to overflow at least one block in each
of the three lookup tables, then mounts it and ensures the kernel rejects
corrupted tables instead of misparsing them. The corrupt image is built in
C and mounted via the framework’s device/mount support.
9.3 binfmt_misc
Tests of the binfmt_misc registration interface. binfmt_misc_lib.sh
modprobes/mounts a binfmt_misc instance at a test mntpoint
(ltp_binfmt_misc), and the tests register interpreter entries by writing to
$mntpoint/register (kernel types M = magic, E = extension), then exec
a file and check whether the registered interpreter ran. Unregistration is
echo -1 >$mntpoint/<name>.
binfmt_misc01.sh— 9 cases.binfmt_misc02.sh— 6 cases; explicitly covers recognised (magic or extension matched) vs not recognised (mismatch) binaries, and exercises registering with various delimiter characters.
Data files under binfmt_misc/datafiles/ supply the magic-prefixed/
interpreter binaries.
10. POSIX ACL tests
Six C tests (acl_user_obj01, acl_mask01, acl_other01, acl_inherit01,
acl_file_ops01, acl_link01). They do not link against libacl: the
shared header acl_lib.h is a self-contained, libacl-semantics-compatible
shim that implements acl_get_file/acl_set_file/acl_create_def_file/
acl_delete_def_file directly on top of the system.posix_acl_access /
system.posix_acl_default xattr payload (it also treats ENODATA as
“equivalent to st_mode”, mirroring the kernel’s behaviour of dropping an
ACL xattr that does not differ from the mode bits).
- acl_user_obj01 — ACL_USER_OBJ entries map onto traditional owner
permission bits;
acl_get_file/acl_set_fileround-trips agree withchmod. - acl_mask01 — the ACL_MASK entry correctly limits the effective rights
of group-class entries (the classic mask semantics:
lsshows+, group bits become the mask). - acl_other01 — ACL_OTHER_OBJ mapping to “other” bits.
- acl_inherit01 — default ACLs on directories are inherited by new
files/subdirs (
acl_create_def_file, inheritance atcreattime). - acl_file_ops01 — ACL get/set/delete/validity (
acl_set_file,acl_delete_def_file, invalid ACL rejection). - acl_link01 — ACL operations on files reached through hard/symlinks (ACLs attach to inodes, not names).
Each follows the pattern: set up known ACL state via the shim, stat / try
open under the relevant uid, and assert the kernel’s access decision matches
POSIX 1003.1e draft 17 semantics.
11. Syscall tests
~60 directories / ~359 test files target filesystem syscalls directly. Unlike
the stress suites above, these are focused functional/conformance tests:
one small test file per documented behavior, mostly on the new
tst_test.h API with auto-generated struct tst_test variants. Categories:
11.1 Namei/namespace
open (16 tests: O_CREAT/O_EXCL/O_TRUNC combos, symlink loops → ELOOP,
O_DIRECTORY, /proc/self/fd reopens…), openat, openat2 (RESOLVE_*
flags), creat, close (EBADF, flushing), close_range, dup/dup2/dup3,
chdir/fchdir, chroot, readlink/readlinkat, symlink/symlinkat,
link/linkat, unlink/unlinkat, rename/renameat/renameat2
(RENAME_NOREPLACE/EXCHANGE/WHITEOUT, EEXIST/ENOTEMPTY/EISDIR matrix — 15
tests), mkdir/mkdirat, rmdir, mknod, access/faccessat/faccessat2,
realpath-style checks in getcwd, name_to_handle_at/open_by_handle_at.
11.2 Metadata
stat/fstat/lstat/fstatat/statx (12 tests: STATX_* masks, mount-id
changes, time granularity, AT_EMPTY_PATH), chmod/fchmod/fchmodat,
chown/fchown/lchown/fchownat (incl. clear-setuid-on-write behavior),
umask, utime/utimes/utimensat/futimens (timestamp setting incl.
UTIME_NOW/OMIT), statfs/fstatfs/statvfs (magic-number and field
sanity), statmount/listmount (new mount API queries).
11.3 Data I/O
read/write (buffer handling, partial writes, post-EOF reads),
readv/writev, pread/pwrite (+ v2 variants), lseek (holes,
SEEK_DATA/SEEK_HOLE), mmap (file-backed, MAP_SHARED coherence), sendfile,
copy_file_range (cross-fs, EOF behavior), splice/tee/vmsplice,
readahead, fallocate (modes, hole punching via EXT4 ioctl paths),
truncate/ftruncate.
11.4 Consistency
fsync (4 tests incl. fsync-after-write-to-new-file durability),
fdatasync, sync, syncfs, sync_file_range.
11.5 xattr
setxattr/lsetxattr/fsetxattr, getxattr/lgetxattr, listxattr,
removexattr: value round-trips, ENOATTR/EEXIST/ENOSPC error paths,
namespace handling (user., security., trusted.* as root).
11.6 Events
inotify (init/watch/add/rm, event coalescing, IN_* masks — many tests) and
fanotify (large suite: FAN_* events, permission events, marks, filesystem
vs mount vs inode marks, notification groups, FAN_REPORT_FID).
11.7 File locks
fcntl (many tests: F_SETLK/F_SETLKW/F_GETLK across processes, deadlock
detection, close-on-exec lock release), flock, plus the older
fcntl-locktests suite in testcases/kernel/.
11.8 Quotas
quotactl (see §8.1).
How these tests work mechanically: most are one file each with a
struct tst_test defining .test = run_fn, .tcnt or a .tests[] array of
variant structs; the framework calls setup() (create tmp files, possibly
format/mount a loop device via .needs_device + .format_device +
.dev_fs_opts), runs each variant in a forked child (so crashes are caught
and reported as TBROK), and calls cleanup(). Verification is usually a
direct syscall-result assertion plus errno comparison, occasionally with a
child process dropping privileges via .child_needs_reinit or fork+setuid
to test permission-dependent behavior.
12. Infrastructure
include/tst_test.h+lib/— new test API: setup/run/cleanup lifecycle, forked test variants,.needs_root,.needs_device,.format_device,.mount_device,.all_filesystems(runs the test on every fs type the host can mkfs!),.skip_filesystems, tmpdir handling, runtime statistics (.test_variants), andSAFE_*macros.tst_fill_fs()(used byfs_fill) — library helper that fills a filesystem with a chosen access pattern (random/sequential) until ENOSPC.testcases/lib/tst_test.sh— shell equivalent used byfs_bind,fs_racer,isofs,binfmt_misc,quota_remount,test_robind.kirk/ scenario files — the execution matrix (§13); themetadata/directory holds per-test metadata (parsed bymetadata/parse.shand consumed by kirk, replacing the oldltp-pan/runltpmachinery).
13. Running via kirk
The legacy
runltpscript has been removed from LTP. Running it now just prints “runltp was removed from LTP use kirk instead” and exits 1. The official executor is kirk (https://github.com/linux-test-project/kirk, docs https://kirk.readthedocs.io), a fork of runltp-ng by SUSE. Theruntest/*scenario files are unchanged — kirk simply reads them.
13.1 Prerequisites
./configure && make -j"$(nproc)" && make install # installs into /opt/ltp
# kirk lives in the tools/kirk git submodule; `make install` only installs it
# if the submodule is checked out (the rule is guarded by a wildcard on
# libkirk/*.py), so initialise it *before* building:
git submodule update --init tools/kirk/kirk-src
Alternatives to the in-tree copy: pip install --user kirk (PyPI), or run
the wrapper directly from a checkout: tools/kirk/kirk-src/kirk. Kirk is
plain Python 3 (kirk → libkirk.main.run()); LTPROOT (default
/opt/ltp) tells it where the tests and scenario files live.
13.2 Suite discovery
- A suite is a file
$LTPROOT/runtest/<name>.kirk -f fstherefore reads$LTPROOT/runtest/fs. Verified with--dry-run: kirk lists every tag it found and splits them into parallel and serial tests. - Each non-comment line
TAG command args...becomes one test; the command is resolved through$LTPROOT/testcases/bin(appended toPATH) — so a test whose binary is missing is reported as fail, not “broken”. - The suite is read inside the SUT, so for remote runs the file must exist on the remote side.
13.3 Invocations
All of the following were exercised against kirk v4.2.0 in this tree
(--dry-run where a real LTP install was not available):
# the main filesystem stress suite (runtest/fs)
kirk --run-suite fs # short form: kirk -f fs
# other filesystem suites
kirk -f fs_bind # 95 mount-propagation tags
kirk -f fs_readonly # 54 tags; needs LTP_BIG_DEV=/dev/sdX
kirk -f fs_perms_simple # 18 permission-matrix tags
# several suites in one session (single report/summary)
kirk -f fs fs_bind fs_perms_simple # verified: "Total tests: 168"
# list what would run without executing anything (CI planning)
kirk -f fs --dry-run
kirk -f fs --dry-run --no-colors # machine-friendly listing
13.4 Select & skip
# only tests whose TAG matches a regex (requires -f)
kirk -f fs -p 'gf2[0-9]|fs_di' # verified: gf20..gf29 + fs_di = 11 tests
# skip by regex
kirk -f fs -s 'gf.*' # everything except the growfiles cases
# skip a list of tags from a file (one per line)
printf 'gf01\ngf02\n' > /tmp/skip.lst
kirk -f fs -S /tmp/skip.lst
# run one specific suite entry only (works even for commands not in any suite)
kirk --run-command 'testcases/bin/fs_fill'
13.5 Parallelism
kirk -f fs_perms_simple --workers 4 # up to N tests in parallel
kirk -f fs --force-parallel # force it (DANGEROUS for stress tests)
A test is auto-parallelized only when metadata/tests/*.json has an entry
for it and that entry contains none of kirk’s blacklist keys
(needs_root, needs_device, format_device, mount_device, mntpoint,
resource_file, save_restore, max_runtime). Old-API tests (all of
growfiles, rwtest, fs_inod, ftest*, …) have no metadata and are
therefore serial by default — which is what you want, since they assume
exclusive use of $TMPDIR and the block device.
13.6 Timeouts
The default --suite-timeout/-T is 1 hour, which is too short for the
full fs suite (growfiles alone run 60–120 s each, rwtest 60 s, plus
fs_di, fsstress, fsx-linux…). Raise it, and/or bound individual runs:
kirk -f fs -T 6h # suite timeout
kirk -f fs -t 1800 # per-test execution timeout (s)
kirk -f fs -I 3600 # stop the session after 1 h of runtime
kirk -f fs -i 3 # repeat the suite 3 times
kirk -f fs -R # randomize test order
LTP_TIMEOUT_MUL=3 kirk -f fs # scale test-internal timeouts (forwarded)
13.7 Results & JSON
kirk -f fs -o results.json # JSON report (refuses to overwrite)
kirk -f fs -m /tmp/monitor.json # live monitor file
kirk -f fs -r /tmp/kirk.sessiondir # restore/continue a session
The JSON report has three top-level objects — results (per test:
test_fqn, status, test.command, test.log, test.retval,
test.duration, counters, test.result), stats
(passed/failed/broken/skipped/warnings, runtime) and environment
(kernel, cmdline, arch, distro, cpu, swap).
CI caveat (verified on v4.2.0): kirk’s exit status is 0 even when tests fail;
1is returned only for a framework error and130for Ctrl-C. Gate CI on the report instead, e.g.jq -e '.stats.failed == 0 and .stats.broken == 0' results.json. Note-ois only written on a real run, not with--dry-run.
Console output also carries a TEST SUMMARY with a Failures: list naming
every failed tag, which is handy for humans.
13.8 Remote SUT
# run the very same suites on a remote machine or VM
kirk --sut ssh --sut 'host=10.0.0.5,user=root' -f fs
kirk --sut qemu --sut 'image=/var/lib/avocado/images/f39.qcow2' -f fs
kirk --sut ltx --sut 'host=10.0.0.5' -f fs
The LTP tree, runtest/ files and LTPROOT must be present inside the SUT.
This is the main reason to prefer kirk over the old shell runner: the same
scenario runs locally or remotely without changes.
13.9 Per-fs runs
kirk forwards every LTP_*/TST_* variable from your shell into the tests,
so the filesystem-selection switches from §14 work unchanged:
LTP_DEV_FS_TYPE=xfs kirk -f fs_perms_simple # device-backed tests on XFS
LTP_SINGLE_FS_TYPE=btrfs kirk -f fs_perms_simple # .all_filesystems tests
LTP_BIG_DEV=/dev/sdb kirk -f fs_readonly # RO-bind matrix
TMPDIR=/mnt/ltp-ext4 kirk -f fs # classic stress tools on ext4
TMPDIR is special-cased by kirk (it is one of its preset variables), which
makes the last form the standard way to run the classic fs suite on a
particular mounted filesystem (§14.3).
13.10 Custom suite
Any file in $LTPROOT/runtest/ is a valid suite, so a custom/aggregated
scenario only needs to be dropped in place:
sudo cp /tmp/10.1.z /opt/ltp/runtest/10.1.z
kirk -f 10.1.z --dry-run # inspect: "Suite: 10.1.z"
kirk -f 10.1.z -T 12h -o 10.1.json
Example: /tmp/10.1.z — a 1305-line aggregated “everything I/O”
scenario (1050 tags) that is a superset of runtest/fs. Its composition:
| Group | Tags | Notes |
|---|---|---|
growfiles (gf01–gf30) | 30 | same as runtest/fs |
rwtest01–05, iogen01 | 6 | buffered/sync/mmap + iogen|doio |
classic binaries (ftest*, stream*, inode01, lftest, writetest, openfile01) | ~20 | as in runtest/fs |
fs_inod01, linker01, fs_di, proc01, isofs, fs_fill, binfmt_misc*, squashfs01, quota_remount, fs_racer | ~12 | as in runtest/fs |
fs_perms01–18 | 18 | permission matrix (normally its own suite) |
fs_bind* | 95 | whole bind-mount/namespace family |
test_robind01–55 | 55 | read-only bind matrix (needs LTP_BIG_DEV) |
dio01–dio30 | 30 | diotest* O_DIRECT variants |
FCNTL_LOCKTESTS | 1 | locktests -n 100 |
syscall tests (chmod, chown, open*, read*, write*, fcntl*, mmap*, mount*, quotactl*, stat*, xattr*, inotify*, fanotify*, io_uring*, splice, sendfile, userns*, mountns*, …) | ~780 | the bulk of the file |
df01_sh | 1 | from runtest/commands |
Practical caveats when running it:
- Root is required —
fs_bind,test_robind,mount*,swapon*,quotactl*,io_perm/iopl,fanotifyand most device-backed tests. test_robind*needsLTP_BIG_DEV(≥500 MB) or all 55 tagsTCONF.inode02does not exist in the current tree (testcases/kernel/fs/inode/only providesinode01) — kirk will reportinode02as fail because the command cannot be resolved. Drop the line or expect one known failure.- Three tags are duplicated (
open_tree01,open_tree02,splice02appear twice), so they are executed twice; harmless but noisy in reports. - Expect a long run: raise
-T, and consider--workersfor the syscall-only portion (or split the file into per-area suites — that is exactly whatruntest/does upstream). - The classic stressors are intentionally destructive — run only on a throw-away VM, never on a production system.
14. Choosing the fs
LTP has a well-defined mechanism for choosing which filesystem a test runs
on. It only applies to tests that use a block device (.needs_device +
.format_device/.mount_device or .all_filesystems) — the classic stress
suites (§3, §4, §6) operate on whatever directory you point them at and must be
driven manually onto a mounted fs of your choice (§14.5).
14.1 fs selection
The decision logic (in lib/tst_test.c / lib/tst_device.c /
lib/tst_supported_fs_types.c):
A test requests a device via .needs_device
-> device = $LTP_DEV if set & big enough,
otherwise a loop device is created from test_dev.img
(default 128 MB, raised by .dev_min_size; tst_acquire_loop_device())
fs_type = $LTP_DEV_FS_TYPE (default: ext2) <- for single-fs tests
if .all_filesystems is set:
fs list = tst_get_supported_fs_types(.skip_filesystems)
-> each fs from fs_type_whitelist that passes 3 checks:
1. in-kernel support (probe mount; FUSE fallback via mount.<fs>)
2. mkfs.<fs> installed (or tmpfs, which needs no mkfs)
3. not in the test's .skip_filesystems blacklist
-> $LTP_SINGLE_FS_TYPE / $LTP_FORCE_SINGLE_FS_TYPE can collapse
this list to exactly one filesystem
For EACH selected filesystem, the framework loops:
format (SAFE_MKFS with per-fs options)
mount at .mntpoint (with per-fs flags/data)
run setup() -> test() -> cleanup() [independent iteration]
umount
Key data points from the source:
- Whitelist of filesystems probed for
.all_filesystems(inlib/tst_supported_fs_types.c):ext2, ext3, ext4, xfs, btrfs, bcachefs, vfat, exfat, ntfs, ntfs3, tmpfs— f2fs is NOT in the auto-list and must be requested explicitly via$LTP_DEV_FS_TYPE/.filesystems(or patched into the whitelist), but it works fine for single-fs tests because it is checked bytst_fs_is_supported()on demand (kernel support +mkfs.f2fs). - Kernel support probe: the library actually attempts
mount("/dev/zero", tmpdir, fs_type, 0, NULL)and treats success orerrno != ENODEVas “kernel supports it”; FUSE-based filesystems (ntfs, and bcachefs via FUSE blacklist) are supported if/dev/fuseexists andmount.<fs>is installed. - mkfs probe: runs
mkfs.<fs>and checks it exists (tmpfsis exempt). - The shell API mirrors this exactly (
testcases/lib/tst_test.sh):TST_NEEDS_DEVICE,TST_FORMAT_DEVICE,TST_MOUNT_DEVICE,TST_ALL_FILESYSTEMS,TST_SKIP_FILESYSTEMS,TST_MNTPOINT, and the sameLTP_DEV_FS_TYPE/LTP_SINGLE_FS_TYPEvariables.
14.2 Env variables
| Variable | Effect |
|---|---|
LTP_DEV | Use this real block device (e.g. /dev/sdb, an NVMe partition, or a manually prepared loop device) instead of an auto-created loop file. Used if its size ≥ .dev_min_size. |
LTP_DEV_FS_TYPE | Filesystem used by single-filesystem tests (.format_device/.mount_device without .all_filesystems). Default: ext2. Set to xfs, ext4, btrfs, f2fs, … |
LTP_SINGLE_FS_TYPE | For .all_filesystems tests: run only on this one filesystem (still respects the test’s skiplist). |
LTP_FORCE_SINGLE_FS_TYPE | Same, but ignores the test’s skiplist (for testing purposes). Only one of the two may be set. |
LTP_BIG_DEV | Large block device (≥500 MB) used by shell-driven suites such as test_robind.sh (§7.2). |
LTP_TIMEOUT_MUL / LTP_RUNTIME_MUL | Scale timeouts/runtimes (useful on slow fs like FUSE/btrfs-on-loop). |
(Documented in doc/users/setup_tests.rst and in each test binary’s -h output.)
14.3 Recipes
Run the whole fs scenario against an ext4 filesystem — for the classic
stress tools there is no kirk switch for this; instead give them a directory on a
filesystem you prepared:
# prepare a test filesystem (real device or loop)
truncate -s 2G /tmp/ltp-ext4.img
mkfs.ext4 -F /tmp/ltp-ext4.img
mkdir -p /mnt/ltp-ext4
mount -o loop /tmp/ltp-ext4.img /mnt/ltp-ext4
# point the classic tests at it via TMPDIR
TMPDIR=/mnt/ltp-ext4 kirk -f fs
Most runtest/fs entries (growfiles -d $TMPDIR, fs_inod $TMPDIR,
fs_di -d $TMPDIR, …) honor $TMPDIR, so this retargets the bulk of the
suite. The same works for xfs, btrfs, f2fs (just mkfs.<type> the
image first). For f2fs note it needs mkfs.f2fs and kernel module f2fs.
Run a device-based test on one specific filesystem:
export LTPROOT=/opt/ltp
cd /opt/ltp/testcases/bin
# single-fs tests (fs_fill, quotactl, statx05, ioctl*, ...):
LTP_DEV_FS_TYPE=xfs ./fs_fill
LTP_DEV_FS_TYPE=btrfs ./quotactl02
LTP_DEV_FS_TYPE=f2fs ./statx05
# all_filesystems tests, restricted to one fs:
LTP_SINGLE_FS_TYPE=ext4 ./fs_fill
LTP_SINGLE_FS_TYPE=btrfs ./inode01
# use a real disk instead of a loop file (faster, larger):
sudo LTP_DEV=/dev/nvme0n2 LTP_DEV_FS_TYPE=xfs ./fs_fill
Run an .all_filesystems test across everything supported:
# runs ext2, ext3, ext4, xfs, btrfs, vfat, exfat, tmpfs, ... (whatever
# the kernel + mkfs tools support); each fs gets a fresh mkfs+mount+run
sudo ./fs_fill # .all_filesystems = 1
sudo ./inode01
Read-only bind suite on a specific fs:
LTP_BIG_DEV=/dev/sdb kirk -f fs_readonly # mkfs.* run inside script
fsx-linux / fsstress against a chosen filesystem: fsstress writes to
-d <dir>, and fsx-linux works in its own tmpdir (so point TMPDIR at
the mount). Simply operate inside a mount of the fs under test:
mount -t f2fs /dev/sdb1 /mnt/t
/opt/ltp/testcases/bin/fsstress -d /mnt/t -p 4 -n 10000
TMPDIR=/mnt/t /opt/ltp/testcases/bin/fsx-linux -N 5000
14.4 struct tst_fs
Tests that need fs-specific mkfs/mount options declare them declaratively
(include/tst_test.h):
struct tst_fs {
const char *type; /* NULL entry = defaults for all */
const char *const *mkfs_opts; /* e.g. "-m", "crc=1" for ext4 */
const char *mkfs_size_opt; /* fs-specific size flag override */
const char *mkfs_ver; /* required mkfs version */
unsigned int mnt_flags;
const void *mnt_data; /* e.g. "usrquota,grpquota" for xfs */
const char *min_kver;
unsigned int mount_check_support:1;
};
Real examples in the tree:
quotactl02.c:.filesystems = {{"xfs", .mnt_data = "usrquota,grpquota"}}— forces XFS with quota mount options.statx05.c:.filesystems = {{"ext4"}}+.needs_cmds = mkfs.ext4 >= 1.43.0, e4crypt— forces ext4 for encryption testing.
Semantics (lib/tst_test.c:prepare_device() / do_setup()):
- If
.all_filesystemsis set, the array is used as a lookup table of per-fs options applied when that fs happens to be selected. - If
.all_filesystemsis NOT set, the array’s non-NULL types are the iteration list — the test runs once per listed type (e.g. a test with{ext4, xfs}entries runs twice). - A single NULL-type entry means “run once on the default filesystem”
(
$LTP_DEV_FS_TYPE).
So to run such a multi-fs test on only one of its filesystems, again use
LTP_SINGLE_FS_TYPE/LTP_DEV_FS_TYPE.
14.5 Which mechanism
| Test/suite | How to target xfs/ext4/btrfs/f2fs |
|---|---|
fs_fill, inode01 (.all_filesystems) | LTP_SINGLE_FS_TYPE=xfs ./fs_fill (f2fs possible if supported on the fly; not in the auto-whitelist) |
quotactl*, statx05, ioctl*, fanotify*, file_attr*, getxattr04, copy_file_range01, fallocate*, … (~110 syscall tests using devices) | LTP_DEV_FS_TYPE=btrfs ./testname — automatic loop-device mkfs+mount of that type |
kirk -f fs classics (growfiles, rwtest, fs_inod, fs_di, …) | TMPDIR=/mnt/<fs> kirk -f fs — mount the fs first |
fsstress, fsx-linux | fsstress -d /mnt/<fs> ...; TMPDIR=/mnt/<fs> fsx-linux |
test_robind.sh / runtest/fs_readonly | LTP_BIG_DEV=<device> (script mkfs’s it, ext-family default) |
isofs, squashfs01, binfmt_misc | fixed fs type by nature (ISO9660 / squashfs / binfmt_misc) |
fs_bind* | fs-agnostic (bind mounts of tmpfs dirs) |
Practical notes:
- Install the
mkfs.<type>tools you want tested (e2fsprogs,xfsprogs,btrfs-progs,f2fs-tools, …) — the framework silently skips fs types without them. - Kernel support is probed at runtime; module autoload of e.g.
f2fs.komust work (or be pre-loaded) for the probe to succeed. bcachefsis on the FUSE blacklist (kernel support only);ntfs3maps to thentfsmkfs tool.- On real hardware prefer
LTP_DEVon a fast device: loop-file-backed runs are slow for big suites;LTP_DEVis skipped if smaller than the test’s.dev_min_size(then the library falls back to a loop device).
15. Summary matrix
| Suite | Type | What it verifies | Core technique |
|---|---|---|---|
| growfiles (gf01–30) | stress | growth/shrink/hole data integrity | pattern write + re-read verify |
| iogen/doio/rwtest | stress | syscall-level random I/O correctness | generated ops + data verify + write log |
| fsx-linux | fuzz | silent data corruption | in-memory model vs file content, mmap/truncate ops |
| fsstress | stress | concurrent op mix stability | weighted random ops from XFS test suite |
| ftest01–08, stream, inode01 | classic | POSIX fs semantics under load | bitmap pieces, zero-fill, readv/writev, lseek64, inode-dup checks |
| fs_inod, openfile, fsplough, linktest | stress | inode/FD/link-count handling | rapid create/delete/open, many links |
| fs_fill | stress | ENOSPC behavior | fill-to-full + walk |
| fs_di | integrity | copy correctness incl. fragmentation | byte-compare, frag.c fragmented copies |
| read_all, proc01 | sweep | pseudo-fs readability | read every file, shared-memory queue + workers |
| fs_racer | race | dentry/inode/refcount races | 24 concurrent shell op loops |
| fs_bind (94 scripts / 95 tags) | conformance | mount propagation semantics | self-bind + –make-* + content checks |
| test_robind (54 tags) | conformance | RO-bind write protection | run classic suite, expect failure on ro |
| fs_perms (18 cases) | conformance | permission bit matrix | setuid child + access attempt |
| acl (6 tests) | conformance | POSIX ACL semantics | libacl + access decision |
| isofs, squashfs, binfmt_misc | per-fs | fs-specific features/regressions | crafted images + mount |
| quota_remount, quotactl | conformance | quota interface & remount | syscall checks, loop-mounted image |
| syscalls/* (~359 files) | functional | per-syscall conformance | one behavior per test, forked variants |
The unifying design principles across LTP filesystem tests:
- Model checking over return-code checking — fsx and growfiles compare file content against an expected model, catching silent corruption.
- Written data must persist exactly; holes must read as zero.
- Concurrency as a bug amplifier — fsstress, fs_racer, and the multi-process design of read_all/ftest/inode deliberately race operations.
- One behavior per test case for the syscall layer; whole-system chaos at the stress layer; LTP deliberately maintains both layers.
- Reproducibility —
doiowrite logs, fixed seeds (fsstress -s), bounded op counts (fsx-linux -N), and scenario tags make failures replayable.