Fault injection

Richard Sharpe realrichardsharpe at gmail.com
Sun Mar 8 18:02:45 GMT 2009


Hi folks,

To allow me to develop unit tests for a particular class of problems
(race conditions etc) I am thinking of adding fault injection macros
to Samba. Has anyone done this yet?

My thinking is that, at least for those versions that still use
smb.conf, it would be based around a global switch in config.h and an
smb.conf parameter:

   fault injection = yes|no
   fault injection point = "Injection Point Label"

Then I would define some macros that encapsulate the sort of decisions
I want to use, like random firing of the injection, guaranteed firing
every N times, etc, along with commands to be executed when an
injection point fires.

There would also be some code in the Samba startup that would
initialize the state needed and because I only have to worry about
Linux, I would probably base some of it around GCC constructors to
minimize the intrusiveness in the code and the level of work required.

So, once again, has anyone done this before?
-- 
Regards,
Richard Sharpe


More information about the samba-technical mailing list