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:
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).
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.
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