607e7f6147fd3f36a1990f8c16524653b5ee6157 |
|
04-Jan-2018 |
Phil Carmody <phil@dovecot.fi> |
lib/lib-test: restore DOVECOT_SRAND feature in DEBUG builds
Add a deterministic PRNG, an ability to force its use, and an
ability to re-use the same sequence later.
Since proper random numbers have been forced into use, making
reproducable tests isn't quite as easy as it used to be, it's 3 steps
rather than 2. When seeing an intermittent test failure:
- rerun the tests with environmental variable DOVECOT_SRAND=kiss
- upon seeing a new failure case, note the seed logged at the failure
- debug using DOVECOT_SRAND=<that number>
In non-DEBUG builds, there's no trace of this code, and the
randomisation that is an inherent part of many tests remains
non-reproduceable.
Works with all of the RNG preferences, getrandom/urandom/arc4.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |