mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 10:54:35 +03:00
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:
+6
-1
@@ -7064,7 +7064,12 @@ main(int argc, char **argv)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ztest_fd_rand = open("/dev/urandom", O_RDONLY);
|
||||
/*
|
||||
* Force random_get_bytes() to use /dev/urandom in order to prevent
|
||||
* ztest from needlessly depleting the system entropy pool.
|
||||
*/
|
||||
random_path = "/dev/urandom";
|
||||
ztest_fd_rand = open(random_path, O_RDONLY);
|
||||
ASSERT3S(ztest_fd_rand, >=, 0);
|
||||
|
||||
if (!fd_data_str) {
|
||||
|
||||
Reference in New Issue
Block a user