Skip to content

Conversation

smuppand
Copy link
Contributor

@smuppand smuppand commented Jul 8, 2025

This update improves the robustness and CI compatibility of the rngtest functional test by:

  • Removing dependency on the rngtest return code, which may be unreliable even for acceptable success ratios.
  • Parsing and validating based on FIPS 140-2 success count extracted from output.
  • Allowing minor failure tolerance by accepting tests with ≥ 997 out of 1000 successes.
  • Logging exact success/failure ratio for better visibility, even on failure.
  • Cleaning up unused variable (RNGTEST_RC) to resolve ShellCheck SC2034 warning.
  • Preserving overall format and logging style in line with qcom-linux-testkit test structure.

- Enhanced rngtest run.sh to be resilient to partial failures from rngtest execution.
- Parses FIPS 140-2 success count even if rngtest returns non-zero.
- Adds logging of success count and calculated success percentage.
- Logs detailed diagnostics when rngtest fails to aid CI debugging.
- Automatically falls back to /dev/hwrng if available, otherwise defaults to /dev/urandom.
- Uses a tunable pass threshold (default 997 out of 1000) to avoid CI flakiness due to single-bit anomalies.

Signed-off-by: Srikanth Muppandam <[email protected]>
@smuppand smuppand requested a review from vnarapar July 8, 2025 11:28
Copy link
Contributor

@vnarapar vnarapar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vnarapar vnarapar merged commit 6d511eb into qualcomm-linux:main Jul 9, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants