]> git.ipfire.org Git - thirdparty/bind9.git/commit
Do not call bin/tools/genrandom unconditionally in system tests
authorMichał Kępień <michal@isc.org>
Fri, 24 Aug 2018 07:57:15 +0000 (09:57 +0200)
committerMichał Kępień <michal@isc.org>
Fri, 24 Aug 2018 07:58:08 +0000 (09:58 +0200)
commit9a76ffc61f69d3357b79eb4e56397bd896211c88
tree11093c4142f264be2946332900cb4ddbbb1a39a2
parentdeaf1cff4cb2b3ae57b9f5cb06bb002504cdfd94
Do not call bin/tools/genrandom unconditionally in system tests

$RANDFILE, i.e. bin/tests/system/random.data, should only be written to
if a system test requires support for cryptography and that file does
not already exist.  Otherwise, when multiple system tests are run in
parallel, that file might get truncated due to bin/tools/genrandom.c
using fopen() with mode "w" when writing the destination file.  With
unfortunate timing, this may cause system tests employing BIND tools
which need entropy (e.g. dnssec-keygen) to fail.

Make sure bin/tests/system/metadata/tests.sh no longer calls
bin/tools/genrandom since $RANDFILE is guaranteed to already be created
by the time bin/tools/genrandom is currently called because
bin/tests/system/metadata/prereq.sh uses bin/tests/system/testcrypto.sh.

Make sure bin/tests/system/sfcache/prereq.sh only writes to $RANDFILE if
it does not already exist.

(cherry picked from commit c12388f5e8e27e6028b7fdb4485594731bb9c760)
bin/tests/system/metadata/tests.sh
bin/tests/system/sfcache/prereq.sh