failgen is a small tool used to geneated random failures in systrace(1) policies using a configurable number of failures. this is useful in fault injection tests where you want to observe the error handling of applications. uses a random array of error conditions from errno(2). failgen was inspired by dugsong.

failgen should work with any POSIX compliant AWK system.

please send feedback if you find you want to add something useful to failgen.


failgen.awk policy percent [options]
the policy is a policy file for systrace. the percent is a decimal value between 0 and 1 (ie 0.3) of the percent of "permit" rules you wish to change to a "deny".

options are

-e don't set "deny" for exit (causes core dumps)


a silc client policy, before and after a pass through failgen. (addresses intentionally munged)

modify the policy to inject 10% failure cases, skipping native-exit denial:

$ failgen.awk /home/jose/.systrace/usr_sbin_host 0.1 -e  
Policy: /usr/sbin/host, Emulation: native
        native-fsread: filename eq "/usr/libexec/" then permit
        native-read: permit
        native-mmap: deny[edeadlk]
        native-issetugid: permit
save this file in "/tmp/usr_bin_host" and use it now to test the policy:
$ systrace -a -f /tmp/usr_bin_host host
/usr/libexec/ host: No such file or directory
repeat the policy modification and application testing.


failgen has several major limitations:


failgen-0.1.tar.gz, version 0.1
failgen-0.2.tar.gz, version 0.2


17 november 2002 released 0.1
17 november 2002 released 0.2

jose nazario, 17 november, 2002