Force ztest to always use /dev/urandom

For ztest, which is solely for testing, using a pseudo random
is entirely reasonable.  Using /dev/urandom ensures the system
entropy pool doesn't get depleted thus stalling the testing.
This is a particular problem when testing in VMs.

Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed by: Thomas Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7017 
Closes #7036
This commit is contained in:
Brian Behlendorf
2018-01-12 09:36:26 -08:00
committed by GitHub
parent 6df9f8ebd7
commit e1a0850c35
5 changed files with 12 additions and 16 deletions
-12
View File
@@ -148,15 +148,6 @@ function store_core
fi
}
rngdpid=""
function on_exit
{
if [ -n "$rngdpid" ]; then
kill -9 "$rngdpid"
fi
}
trap on_exit EXIT
# parse arguments
# expected format: zloop [-t timeout] [-c coredir] [-- extra ztest args]
coredir=$DEFAULTCOREDIR
@@ -205,9 +196,6 @@ or_die rm -f ztest.history
or_die rm -f ztest.ddt
or_die rm -f ztest.cores
# start rngd in the background so we don't run out of entropy
or_die read -r rngdpid < <(rngd -f -r /dev/urandom & echo $!)
ztrc=0 # ztest return value
foundcrashes=0 # number of crashes found so far
starttime=$(date +%s)