It aims to simplify automated testing of software behaviour at failure scenarios, for software which is supposed to be fault-resistant or at least gracefully cope with failures.

It provides functions to mark "points of failure" inside your code (the core API), and functions to enable/disable the failure of those points (the control API).

The core API is used inside the code wanting to perform failure injection on. The control API is used inside the testing code, in order to control the injection of failures.

It also comes with some tools that can be used to perform fault injection in the POSIX API without having to modify the application's source code, that can help to test failure handling in an easy and reproducible way.

It's in the public domain, completely open source, so you can run the software anywhere, and link the library with whatever you want.

Examples

fiu-run -x -c 'enable name=posix/io/*' ls

size_t free_space() { fiu_return_on("no_free_space", 0); [code to find out how much free space there is] return space; } bool file_fits(FILE *fd) { if (free_space() < file_size(fd)) { return false; } return true; }

fiu_return_on()

fiu_init(); fiu_enable("no_free_space", 1, NULL, 0); assert(file_fits("tmpfile") == false);

free_space()

Documentation

Articles

Download

Debian and Ubuntu users can also install it using apt-get install libfiu-dev fiu-utils [python-fiu] (note it may be an older version).

Patches are welcome. The source code is managed using git. You can browse the repository, or clone it by running:

git clone https://blitiri.com.ar/repos/libfiu

Users