fault

command
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Fault-injection probe.

Creates a ublk device whose Backend returns EIO on a configurable fraction of operations. Exercises the "backend errors out" code path that the rest of the test suite doesn't touch.

Three scenarios, each with per-step timeout:

  1. low-rate errors (10% of writes) — most operations succeed; the block layer sees occasional EIOs. The test asserts at least some Pwrite()s return an error to the caller — proving errors propagate through the full stack (Backend -> worker -> io_uring CQE -> kernel block layer -> /dev/ublkbN fd).

  2. total failure (100% of writes) — every Pwrite to /dev/ublkbN must return an error. Reads still pass. Verifies we don't silently succeed when the backend is dead.

  3. clean close with pending errors — after injecting writes that fail, Close() must still return without hanging. Exercises the shutdown path when the device is in an unhappy state.

Exit 0 = all scenarios behaved correctly. Non-zero = a scenario misbehaved (e.g. Pwrite returned success when the backend returned EIO), with details.

Requires root and ublk_drv.

sudo /tmp/ublk-fault
make fault

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL