Skip to content

add hsm tests for NXP ELE (New)#2550

Merged
stanley31huang merged 7 commits into
mainfrom
add_ele_test
Jun 16, 2026
Merged

add hsm tests for NXP ELE (New)#2550
stanley31huang merged 7 commits into
mainfrom
add_ele_test

Conversation

@stanley31huang

Copy link
Copy Markdown
Collaborator

Description

Add a new NXP EdgeLock Enclave (ELE) Checkbox test suite for oem-imx-secure-enclave, including dynamic test-vector discovery, per-vector
templated execution, and ELE performance testing.

What this PR adds

  1. New ELE test script
  • units/secure-element/nxp_ele_test.py
  • Supports:
  • --list-tv: enumerate available PSA test vectors and export resource attributes
  • --run-tv : run a single test vector
  • --run-perf: run ele_hsm_perf_test
  • Implements required NVM daemon lifecycle for each run:
  • stop daemon
  • cleanup persisted test data
  • start daemon
  • execute test
  • stop daemon
  • Auto-detects daemon unit names (including snap systemd units).
  1. New Checkbox job definitions
  • units/secure-element/nxp-secure-element.pxu
  • Adds:
  • resource job: nxp_ele_list_tv_files
  • templated TV job family: nxp_ele_run_tv_*
  • perf job: nxp_ele_run_perf
  • Uses template-engine: jinja2 for nxp_ele_run_tv template rendering.
  1. New ELE test plan
  • units/secure-element/test-plan.pxu
  • Adds top-level nxp-ele plan with:
  • resource bootstrap include
  • perf test include
  • all generated TV jobs include via regex.

Resolved issues

Documentation

reference: https://github.com/nxp-imx/imx-secure-enclave

Tests

https://certification.canonical.com/hardware/202601-38315/submission/490071/

add hsm tests for NXP Edge Lock device
@stanley31huang stanley31huang requested a review from a team May 27, 2026 12:37
@stanley31huang stanley31huang added the ce-oem The PR only contains to the ce-oem provider under the contrib area label May 27, 2026

@baconYao baconYao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @stanley31huang, I made some refactor like below

Separation of Concerns (SoC)
The nvm_daemon_lifecycle context manager is now solely responsible for service state management and data cleanup, while run_with_nvm_lifecycle focuses exclusively on command execution and exit code handling.

Prevention of Exception Masking
Inside nvm_daemon_lifecycle, if cleanup_nvm_data() fails and throws an error, the execution aborts immediately with the correct traceback. This prevents the finally block from attempting to stop an already-stopped service, which could raise a secondary RuntimeError and mask the root cause.

Cleaner Caller Interfaces
By streamlining the arguments for run_with_nvm_lifecycle, caller functions no longer need to construct verbose, repetitive strings for success_message and fail_label. Standardizing the output with a single test_label and a prefixed [NXP_ELE] PASS: adheres to the DRY (Don't Repeat Yourself) principle.

Improved Maintainability
If NXP introduces new lifecycle requirements in the future (e.g., adding an extra health check stage to the daemon), you only need to update the nvm_daemon_lifecycle context manager. The actual test execution logic for performance and TV files remains completely untouched.

Comment thread contrib/checkbox-ce-oem/checkbox-provider-ce-oem/bin/nxp_ele_test.py Outdated
applied suggestions
fix coding style issue
baconYao
baconYao previously approved these changes Jun 15, 2026

@baconYao baconYao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@stanley31huang

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved. I merged origin/main into this branch and fixed the conflict in contrib/checkbox-ce-oem/checkbox-provider-ce-oem/tox.ini in commit dcb601d.

remove pyc file
fix coding style issue
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.49%. Comparing base (f2aa6e7) to head (5539d43).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2550   +/-   ##
=======================================
  Coverage   59.49%   59.49%           
=======================================
  Files         480      480           
  Lines       48505    48505           
  Branches     8675     8675           
=======================================
  Hits        28859    28859           
  Misses      18737    18737           
  Partials      909      909           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stanley31huang stanley31huang requested a review from baconYao June 16, 2026 02:59

@baconYao baconYao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@stanley31huang stanley31huang merged commit 891c5d5 into main Jun 16, 2026
17 checks passed
@stanley31huang stanley31huang deleted the add_ele_test branch June 16, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ce-oem The PR only contains to the ce-oem provider under the contrib area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants