From 39a49cc12be9c8946171156f1d3e99d566a64565 Mon Sep 17 00:00:00 2001 From: Roland Mikhel Date: Mon, 12 Jun 2023 10:41:52 +0200 Subject: [PATCH] ci: Add test cases for ECDSA using PSA Crypto Add ECDSA verification tests to the CI using the PSA Crypto API Signed-off-by: Roland Mikhel Change-Id: I904c8929f355ec791ff28ac7c3e0ca3832b2403d --- .github/workflows/sim.yaml | 2 ++ ci/sim_run.sh | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sim.yaml b/.github/workflows/sim.yaml index 79765fbd52..34883f867d 100644 --- a/.github/workflows/sim.yaml +++ b/.github/workflows/sim.yaml @@ -44,6 +44,8 @@ jobs: - "sig-rsa validate-primary-slot ram-load multiimage" - "sig-rsa validate-primary-slot direct-xip multiimage" - "sig-ecdsa hw-rollback-protection multiimage" + - "sig-ecdsa-psa psa-crypto-api" + - "sig-ecdsa-psa psa-crypto-api sig-use-p384" - "ram-load enc-aes256-kw multiimage" - "ram-load enc-aes256-kw sig-ecdsa-mbedtls multiimage" runs-on: ubuntu-latest diff --git a/ci/sim_run.sh b/ci/sim_run.sh index 59d65e10d6..3157d1123b 100755 --- a/ci/sim_run.sh +++ b/ci/sim_run.sh @@ -43,10 +43,20 @@ fi if [[ ! -z $MULTI_FEATURES ]]; then IFS=',' read -ra multi_features <<< "$MULTI_FEATURES" + + # psa crypto tests require single thread mode + TEST_ARGS='' + for features in "${multi_features[@]}"; do + if [[ $features =~ "psa-crypto-api" ]]; then + TEST_ARGS='--test-threads=1' + break + fi + done + for features in "${multi_features[@]}"; do echo "Running cargo for features=\"${features}\"" - time cargo test --no-run --features "$features" - time cargo test --features "$features" + time cargo test --no-run --features "$features" -- $TEST_ARGS + time cargo test --features "$features" -- $TEST_ARGS rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc done fi