Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 in testcases/kernel/fs/, the related runtest/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:

PathPurpose
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 kirk on PATH / /opt/ltp/kirk). It reads the runtest/<scenario> files where each line is TAG command...; each line becomes one “test” whose result (pass/fail/broken/skip) kirk derives from the test’s exit code and output. The legacy runltp script 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 registers struct tst_test with setup(), run() (or run_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.sh with 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 groupCommandSuite
gf01–gf30growfiles ...file growth/shrink/IO stress (§3.1)
rwtest01–rwtest05rwtest ...read/write + mmap IO via iogen/doio (§3.2)
iogen01rwtest -N iogen01 ...raw `iogen
fs_inod01fs_inod $TMPDIR 10 10 10inode alloc/dealloc stress (§4.4)
linker01linktest.shlink count stress (§4.6)
openfile01openfile -f10 -t10many open handles on one file (§4.7)
inode01, stream01–05, ftest01–08classic binary tests§4.1, §4.2
lftest01, writetest01large-file / write test§4.9
fs_difs_di -d $TMPDIRdata-integrity incl. fragmentation (§4.5)
proc01proc01 -m 128read every file in /proc (§5.2)
read_all_dev/proc/sys`read_all -d /dev/proc
fs_racerfs_racer.sh -t 5race-condition stress (§6)
quota_remount_test01scriptquota across remount (§8.2)
isofsisofs.shISO9660 mount/usage (§9.1)
fs_fillfs_fillfill filesystem to ENOSPC (§4.3)
binfmt_misc01/02scriptsbinfmt_misc registration (§9.3)
squashfs01squashfs01squashfs lookup-table overflow regression (§9.2)
acl_*016 binariesPOSIX 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_incr before 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 p pattern, -I r random, -I l/L alternating), and verification distinguishes “never written” (must be zero) from “written” (must match pattern) — the same philosophy as ftest01.
  • Supports growing via lseek instead of write (-w, i.e. hole/sparse creation), FIFOs as targets, -o open-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). -W only 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.c implements an optional write journal: every operation is logged so that a crash mid-run can be replayed/checked (used by fsx-style debugging and by rwtest).

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, mmap variants), 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, pipes iogen into doio, manages duration (-i 60s / iteration counts), strategy selection (-f sync|buffered), and optionally mmread,mmwrite mmap-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:

TestBehaviour
ftest01piece-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).
ftest03same 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).
ftest05identical to ftest01 with lseek64 (large-file offsets).
ftest06identical to ftest02 with lseek64.
ftest07identical to ftest03 with lseek64.
ftest08identical 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/fread a file into a buffer and compare the content read to the expected string (SAFE_FOPEN/SAFE_FREAD).

  • stream02 — fopen() of a FIFO (mknod S_IFIFO) with every mode (r, w, a, r+, …), checking each fopen succeeds.

  • stream03 — stream position semantics on an a+ stream: ftell, fseek(SEEK_SET/CUR/END), rewind return the expected offsets.

  • stream04 — fwrite then reopen r+/fread round-trip: bytes read back must equal the bytes written.

  • stream05 — mixes buffered FILE* writes with raw write(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:

  1. 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, then cmp the two files — any difference is a data-integrity failure. Loops (default 10).
  2. 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 COUNT megabytes (default 100, so 100 MB) to large_file as 1 MB buffers, fsync+lseek after 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 as lftest -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 the fs scenario as writetest01).

4.10 fsstress

A port of the SGI XFS fsstress tool. Model:

  • Maintains a set of named file pools (d dirs, f regular files, l links, c char devices, r rt files) and picks operations weighted-randomly from an operation table. With LTP’s -DNO_XFS build 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 add allocsp/freesp/resvsp/unresvsp/attr_set/attr_remove/bulkstat.)
  • Frequencies are tunable with -f op_name=freq (see -S for the table); -p nproc processes each perform -n nops operations, -l loops repeats the run, -s seed fixes the PRNG, -d dir chooses the base directory.
  • Random offsets/sizes exercise boundary conditions (EOF, holes, partial blocks); -v logs every op as procid/opno: op args; -c keeps 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 mmap MAP_SHARED write/read, so page-cache/msync interactions and EOF shrinking are exercised alongside plain read/write.
  • Randomised but bounded: fixed op count (-N) and bounded file/op sizes keep a run reproducible enough for CI, while timeout = 1800 bounds 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; -w overrides) pop paths and read each file fully.
  • -r N = schedule every file for reading N times (the default is 1; runtest/fs uses -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 -w and CPU count); -p = drop privileges to nobody; -t ms = per-file worker timeout before the worker is restarted.
  • .runtime = 100 caps the overall run; forks_child is 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:

ScriptOperation loop
fs_racer_file_create.shcreate/delete files of random names
fs_racer_file_concat.shappend to files being created/deleted
fs_racer_file_list.shrecursive ls -R while files churn
fs_racer_file_rm.shdelete files
fs_racer_file_link.shcreate/remove hard links
fs_racer_file_symlink.shcreate/remove symlinks
fs_racer_file_rename.shrename files onto each other
fs_racer_dir_create.shcreate/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/ — plain mount --bind semantics (fs_bind01–fs_bind24, plus fs_bind07-2) — 25 scripts.
  • rbind/ — recursive bind (mount --rbind) semantics (fs_bind_rbind01– 39, plus rbind07-2) — 40 scripts.
  • move/ — mount --move semantics (move01–move22) — 22 scripts.
  • cloneNS/ — mount propagation across unshare(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 requires mount, umount, awk, sed.
  • fs_bind_setup creates 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 busybox mount can’t combine them in one command.)
  • fs_bind_check [-n] [-s] dirA dirB ... — verifies that the given subtrees reflect the same propagation (content compared via find/awk); -n asserts that no propagation happened, -s performs 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 group share2, binds disk1 under parent1/child1, then binds parent1/child1 into parent2/child2 and verifies contents propagate to share2/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_file round-trips agree with chmod.
  • acl_mask01 — the ACL_MASK entry correctly limits the effective rights of group-class entries (the classic mask semantics: ls shows +, 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 at creat time).
  • 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), and SAFE_* macros.
  • tst_fill_fs() (used by fs_fill) — library helper that fills a filesystem with a chosen access pattern (random/sequential) until ENOSPC.
  • testcases/lib/tst_test.sh — shell equivalent used by fs_bind, fs_racer, isofs, binfmt_misc, quota_remount, test_robind.
  • kirk / scenario files — the execution matrix (§13); the metadata/ directory holds per-test metadata (parsed by metadata/parse.sh and consumed by kirk, replacing the old ltp-pan/runltp machinery).

13. Running via kirk

The legacy runltp script 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. The runtest/* 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 fs therefore 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 to PATH) — 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; 1 is returned only for a framework error and 130 for Ctrl-C. Gate CI on the report instead, e.g. jq -e '.stats.failed == 0 and .stats.broken == 0' results.json. Note -o is 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:

GroupTagsNotes
growfiles (gf01–gf30)30same as runtest/fs
rwtest01–05, iogen016buffered/sync/mmap + iogen|doio
classic binaries (ftest*, stream*, inode01, lftest, writetest, openfile01)~20as in runtest/fs
fs_inod01, linker01, fs_di, proc01, isofs, fs_fill, binfmt_misc*, squashfs01, quota_remount, fs_racer~12as in runtest/fs
fs_perms01–1818permission matrix (normally its own suite)
fs_bind*95whole bind-mount/namespace family
test_robind01–5555read-only bind matrix (needs LTP_BIG_DEV)
dio01–dio3030diotest* O_DIRECT variants
FCNTL_LOCKTESTS1locktests -n 100
syscall tests (chmod, chown, open*, read*, write*, fcntl*, mmap*, mount*, quotactl*, stat*, xattr*, inotify*, fanotify*, io_uring*, splice, sendfile, userns*, mountns*, …)~780the bulk of the file
df01_sh1from runtest/commands

Practical caveats when running it:

  • Root is required — fs_bind, test_robind, mount*, swapon*, quotactl*, io_perm/iopl, fanotify and most device-backed tests.
  • test_robind* needs LTP_BIG_DEV (≥500 MB) or all 55 tags TCONF.
  • inode02 does not exist in the current tree (testcases/kernel/fs/inode/ only provides inode01) — kirk will report inode02 as fail because the command cannot be resolved. Drop the line or expect one known failure.
  • Three tags are duplicated (open_tree01, open_tree02, splice02 appear twice), so they are executed twice; harmless but noisy in reports.
  • Expect a long run: raise -T, and consider --workers for the syscall-only portion (or split the file into per-area suites — that is exactly what runtest/ 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 (in lib/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 by tst_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 or errno != ENODEV as “kernel supports it”; FUSE-based filesystems (ntfs, and bcachefs via FUSE blacklist) are supported if /dev/fuse exists and mount.<fs> is installed.
  • mkfs probe: runs mkfs.<fs> and checks it exists (tmpfs is 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 same LTP_DEV_FS_TYPE / LTP_SINGLE_FS_TYPE variables.

14.2 Env variables

VariableEffect
LTP_DEVUse 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_TYPEFilesystem used by single-filesystem tests (.format_device/.mount_device without .all_filesystems). Default: ext2. Set to xfs, ext4, btrfs, f2fs, …
LTP_SINGLE_FS_TYPEFor .all_filesystems tests: run only on this one filesystem (still respects the test’s skiplist).
LTP_FORCE_SINGLE_FS_TYPESame, but ignores the test’s skiplist (for testing purposes). Only one of the two may be set.
LTP_BIG_DEVLarge block device (≥500 MB) used by shell-driven suites such as test_robind.sh (§7.2).
LTP_TIMEOUT_MUL / LTP_RUNTIME_MULScale 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_filesystems is set, the array is used as a lookup table of per-fs options applied when that fs happens to be selected.
  • If .all_filesystems is 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/suiteHow 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-linuxfsstress -d /mnt/<fs> ...; TMPDIR=/mnt/<fs> fsx-linux
test_robind.sh / runtest/fs_readonlyLTP_BIG_DEV=<device> (script mkfs’s it, ext-family default)
isofs, squashfs01, binfmt_miscfixed 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.ko must work (or be pre-loaded) for the probe to succeed.
  • bcachefs is on the FUSE blacklist (kernel support only); ntfs3 maps to the ntfs mkfs tool.
  • On real hardware prefer LTP_DEV on a fast device: loop-file-backed runs are slow for big suites; LTP_DEV is skipped if smaller than the test’s .dev_min_size (then the library falls back to a loop device).

15. Summary matrix

SuiteTypeWhat it verifiesCore technique
growfiles (gf01–30)stressgrowth/shrink/hole data integritypattern write + re-read verify
iogen/doio/rwteststresssyscall-level random I/O correctnessgenerated ops + data verify + write log
fsx-linuxfuzzsilent data corruptionin-memory model vs file content, mmap/truncate ops
fsstressstressconcurrent op mix stabilityweighted random ops from XFS test suite
ftest01–08, stream, inode01classicPOSIX fs semantics under loadbitmap pieces, zero-fill, readv/writev, lseek64, inode-dup checks
fs_inod, openfile, fsplough, linkteststressinode/FD/link-count handlingrapid create/delete/open, many links
fs_fillstressENOSPC behaviorfill-to-full + walk
fs_diintegritycopy correctness incl. fragmentationbyte-compare, frag.c fragmented copies
read_all, proc01sweeppseudo-fs readabilityread every file, shared-memory queue + workers
fs_racerracedentry/inode/refcount races24 concurrent shell op loops
fs_bind (94 scripts / 95 tags)conformancemount propagation semanticsself-bind + –make-* + content checks
test_robind (54 tags)conformanceRO-bind write protectionrun classic suite, expect failure on ro
fs_perms (18 cases)conformancepermission bit matrixsetuid child + access attempt
acl (6 tests)conformancePOSIX ACL semanticslibacl + access decision
isofs, squashfs, binfmt_miscper-fsfs-specific features/regressionscrafted images + mount
quota_remount, quotactlconformancequota interface & remountsyscall checks, loop-mounted image
syscalls/* (~359 files)functionalper-syscall conformanceone behavior per test, forked variants

The unifying design principles across LTP filesystem tests:

  1. Model checking over return-code checking — fsx and growfiles compare file content against an expected model, catching silent corruption.
  2. Written data must persist exactly; holes must read as zero.
  3. Concurrency as a bug amplifier — fsstress, fs_racer, and the multi-process design of read_all/ftest/inode deliberately race operations.
  4. One behavior per test case for the syscall layer; whole-system chaos at the stress layer; LTP deliberately maintains both layers.
  5. Reproducibility — doio write logs, fixed seeds (fsstress -s), bounded op counts (fsx-linux -N), and scenario tags make failures replayable.