Closed
Description
Consider the case of Linux. We hope to use the getrandom
syscall and then if that fails, we fall back to doing file I/O. We should test at least the following scenerios:
- Linux returns
ENOSYS
, which should trigger the fallback to file I/O. - Linux returns
EPERM
, which is presently expected to do the same fallback, though there's an issue on file to change this. - The syscall succeeds.
This type of exhaustive testing might not be practical on all targets. However, BoringSSL has shown how to do it on Linux; see https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/rand/urandom_test.cc.
Backends with runtime fallback logic: