Skip to content

Commit 3a2282b

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

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

.github/workflows/simulation-1.4.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,111 @@ jobs:
414414
path: tmp/coverage.info
415415
retention-days: 1
416416

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

0 commit comments

Comments
 (0)