Commit 95bb884
committed
rngtest: Add timeout for /dev/hwrng and fallback to /dev/urandom
This enhancement improves robustness of the rngtest validation script in CI environments by:
- Adding a timeout of 10 seconds when reading from /dev/hwrng to prevent hanging.
- Automatically falling back to /dev/urandom if hwrng read fails or times out.
- Logging the entropy source clearly (hwrng or urandom).
- Including verbose output and entropy source decision logging for better CI debuggability.
Also improves:
- ShellCheck compliance
- Graceful cleanup of temporary files in all exit paths
This makes the test resilient in both hardware-supported and minimal (hwrng-absent) environments.
Signed-off-by: Srikanth Muppandam <[email protected]>1 parent 5f488f2 commit 95bb884
1 file changed
+22
-9
lines changedLines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
60 | 74 | | |
61 | | - | |
62 | 75 | | |
63 | 76 | | |
64 | 77 | | |
| |||
0 commit comments