]> git.ozlabs.org Git - ccan/commit
tdb2: use failtest for opening and checking database.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
commit871277c1dadd546a4e6973c1646d04554e43be62
tree84cfa90f01577334725bf6d96a36fc39f123d944
parentc56e2b1b5e51b094d53f4012e226b352a91618f6
tdb2: use failtest for opening and checking database.

This is a fairly sophisticated use of failtest:
1) There are a few places where we can inject failures without revealing it
   at the API level, eg. opening /dev/urandom, or allocation failure in logging.
2) We want to be sure that (almost) all failures cause a message to be logged.
3) We need to exit as soon as possible when a failure is injected, to avoid
   combinatorial explosion.
4) We don't want to simply exit on any log message, since we want to be sure
   that cleanup happens.

This test found four different bugs failure paths.  Erk!
ccan/tdb2/_info
ccan/tdb2/test/run-01-new_database.c