Skip to content

Commit 3ed9fa8

Browse files
committed
[crypto] PSA API: add basic unit, cert and expect testing in CI
This commit introduces initial CI testing of PSA Crypto variant. Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
1 parent aa3c246 commit 3ed9fa8

File tree

2 files changed

+98
-3
lines changed

2 files changed

+98
-3
lines changed

.github/workflows/simulation-1.4.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,111 @@ jobs:
419419
path: tmp/coverage.info
420420
retention-days: 1
421421

422+
cli-psa:
423+
runs-on: ubuntu-24.04
424+
env:
425+
COVERAGE: 1
426+
THREAD_VERSION: 1.4
427+
VIRTUAL_TIME: 1
428+
INTER_OP_BBR: 1
429+
steps:
430+
- name: Harden Runner
431+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
432+
with:
433+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
434+
435+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
436+
with:
437+
submodules: true
438+
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
439+
with:
440+
python-version: '3.12'
441+
cache: pip
442+
- name: Bootstrap
443+
run: |
444+
sudo apt-get update
445+
sudo apt-get --no-install-recommends install -y g++-multilib lcov ninja-build
446+
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
447+
- name: Build
448+
run: |
449+
OT_OPTIONS="-DOT_PLATFORM_KEY_REF=ON -DOT_CRYPTO_LIB=PSA" OT_NODE_TYPE=cli ./script/test build
450+
- name: Run
451+
run: |
452+
./script/test unit
453+
OT_NODE_TYPE=cli ./script/test cert_suite ./tests/scripts/thread-cert/Cert_*.py ./tests/scripts/thread-cert/test_*.py
454+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
455+
if: ${{ failure() }}
456+
with:
457+
name: cli-psa
458+
path: ot_testing
459+
- name: Generate Coverage
460+
run: |
461+
./script/test generate_coverage gcc
462+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
463+
with:
464+
name: cov-cli-psa
465+
path: tmp/coverage.info
466+
retention-days: 1
467+
468+
cli-psa-expects:
469+
runs-on: ubuntu-24.04
470+
env:
471+
COVERAGE: 1
472+
THREAD_VERSION: 1.4
473+
VIRTUAL_TIME: 0
474+
steps:
475+
- name: Harden Runner
476+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
477+
with:
478+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
479+
480+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
481+
with:
482+
submodules: true
483+
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
484+
with:
485+
python-version: '3.12'
486+
cache: pip
487+
- name: Bootstrap
488+
run: |
489+
sudo apt-get --no-install-recommends install -y expect ninja-build lcov
490+
sudo bash script/install_socat
491+
pip install bleak 'cryptography==43.0.0'
492+
- name: Run CLI Mode
493+
run: |
494+
ulimit -c unlimited
495+
./script/test prepare_coredump_upload
496+
OT_OPTIONS="-DOT_PLATFORM_KEY_REF=ON -DOT_CRYPTO_LIB=PSA -DOT_TIME_SYNC=ON -DOT_BLE_TCAT=ON" OT_NODE_TYPE=cli ./script/test build expect
497+
- name: Check Crash
498+
if: ${{ failure() }}
499+
run: |
500+
CRASHED=$(./script/test check_crash | tail -1)
501+
[[ $CRASHED -eq "1" ]] && echo "Crashed!" || echo "Not crashed."
502+
echo "CRASHED=$CRASHED" >> $GITHUB_ENV
503+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
504+
if: ${{ failure() && env.CRASHED == '1' }}
505+
with:
506+
name: core-cli-psa-expects-1-4
507+
path: |
508+
./ot-core-dump/*
509+
- name: Generate Coverage
510+
run: |
511+
./script/test generate_coverage gcc
512+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
513+
with:
514+
name: cov-cli-psa-expects
515+
path: tmp/coverage.info
516+
retention-days: 1
517+
422518
upload-coverage:
423519
needs:
424520
- thread-1-4
425521
- packet-verification-low-power
426522
- packet-verification-1-1-on-1-4
427523
- expects
428524
- thread-1-4-posix
525+
- cli-psa
526+
- cli-psa-expects
429527
runs-on: ubuntu-22.04
430528
steps:
431529
- name: Harden Runner

.github/workflows/toranj.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ jobs:
180180
./tests/toranj/build.sh --log-level CRIT all
181181
git clean -dfx
182182
./tests/toranj/build.sh --log-level NONE all
183-
#- - - - - - - - - - - - - - - - - - - - - - - - - - -
184-
git clean -dfx
185-
./tests/toranj/build.sh --enable-plat-key-ref all
186183
187184
toranj-macos:
188185
name: toranj-macos

0 commit comments

Comments
 (0)