[dovecot/core] 607e7f: lib/lib-test: restore DOVECOT_SRAND feature in DEB...

GitHub noreply at github.com
Thu Jan 4 18:30:11 EET 2018


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: 607e7f6147fd3f36a1990f8c16524653b5ee6157
      https://github.com/dovecot/core/commit/607e7f6147fd3f36a1990f8c16524653b5ee6157
  Author: Phil Carmody <phil at dovecot.fi>
  Date:   2018-01-04 (Thu, 04 Jan 2018)

  Changed paths:
    M src/lib-test/test-common.c
    M src/lib/randgen.c
    M src/lib/randgen.h

  Log Message:
  -----------
  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 at dovecot.fi>




More information about the dovecot-cvs mailing list