Skip to content

Refactor crypto tests#5593

Open
bugadani wants to merge 2 commits into
esp-rs:mainfrom
bugadani:crypto-test-refactor
Open

Refactor crypto tests#5593
bugadani wants to merge 2 commits into
esp-rs:mainfrom
bugadani:crypto-test-refactor

Conversation

@bugadani
Copy link
Copy Markdown
Contributor

@bugadani bugadani commented May 22, 2026

Splits classic/work-queue tests into separate modules, so that we can properly initialize the drivers instead of the unsafe hackery we've had before - and without the accidental refcount retention issues we've had with the previous solution.

@github-actions github-actions Bot added the merge-conflict Merge conflict detected. Automatically added/removed by CI. label May 26, 2026
@github-actions
Copy link
Copy Markdown

New commits in main have made this PR unmergeable. Please resolve the conflicts.

@bugadani bugadani force-pushed the crypto-test-refactor branch from 4e909ce to bef52eb Compare May 26, 2026 18:02
@bugadani bugadani marked this pull request as ready for review May 26, 2026 18:02
Copilot AI review requested due to automatic review settings May 26, 2026 18:02
@github-actions github-actions Bot removed the merge-conflict Merge conflict detected. Automatically added/removed by CI. label May 26, 2026
@bugadani bugadani force-pushed the crypto-test-refactor branch from bef52eb to adff32f Compare May 26, 2026 18:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the crypto HIL tests to better separate concerns between “direct driver” tests and work-queue/back-end tests, reducing per-test boilerplate and removing ad-hoc peripheral acquisition in favor of module #[init] contexts.

Changes:

  • Refactored SHA tests by hoisting shared helpers to module scope and splitting SHA work-queue tests into a dedicated work_queue_tests module with its own Context.
  • Refactored AES tests by splitting work-queue CPU tests into work_queue_tests (with an embedded-test executor for async coverage) and DMA work-queue tests into work_queue_dma_tests (gated by #[cfg(aes_dma)]).
  • Replaced unsafe { peripherals::...::steal() } patterns in work-queue tests with safe peripheral ownership via esp_hal::init(...) in module #[init].

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
hil-test/src/bin/crypto/sha.rs Moves common SHA test helpers to module scope and splits work-queue SHA backend tests into a separate embedded-test module with a proper init context.
hil-test/src/bin/crypto/aes.rs Splits AES work-queue tests into CPU/async and DMA-specific embedded-test modules, each with an init context to own the backend(s).

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