From 623eda97004dc0f99ec5e93e319f95f85b9a7b07 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 11 Sep 2025 18:11:25 +0200 Subject: [PATCH 1/4] Update framework with psa_compliance.py module Signed-off-by: Gilles Peskine --- framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework b/framework index 122857f784..9eef07b93d 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 122857f784cc439d887f0b276fce798835f764d6 +Subproject commit 9eef07b93d1e75dbf8c507d6af5e2286f9c7fe83 From 22885b6bd9ad82b319d9611f7a1ef8071c0f91fd Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 11 Sep 2025 18:12:11 +0200 Subject: [PATCH 2/4] Import PSA compliance test script entry point from the framework Signed-off-by: Gilles Peskine --- tests/scripts/test_psa_compliance.py | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 tests/scripts/test_psa_compliance.py diff --git a/tests/scripts/test_psa_compliance.py b/tests/scripts/test_psa_compliance.py new file mode 100755 index 0000000000..025c8b96d0 --- /dev/null +++ b/tests/scripts/test_psa_compliance.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +"""Run the PSA Crypto API compliance test suite. + +Clone the repo and check out the commit specified by PSA_ARCH_TEST_REPO and PSA_ARCH_TEST_REF, +then compile and run the test suite. The clone is stored at /psa-arch-tests. +Known defects in either the test suite or TF-PSA-Crypto - identified by their test +number - are ignored, while unexpected failures AND successes are reported as errors, to help +keep the list of known defects as up to date as possible. +""" + +# Copyright The Mbed TLS Contributors +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later + +from typing import List + +import scripts_path # pylint: disable=unused-import +from mbedtls_framework import psa_compliance + +PSA_ARCH_TESTS_REF = 'v23.06_API1.5_ADAC_EAC' + +# PSA Compliance tests we expect to fail due to known defects in Mbed TLS / +# TF-PSA-Crypto (or the test suite). +# The test numbers correspond to the numbers used by the console output of the test suite. +# Test number 2xx corresponds to the files in the folder +# psa-arch-tests/api-tests/dev_apis/crypto/test_c0xx +EXPECTED_FAILURES = [] # type: List[int] + +if __name__ == '__main__': + psa_compliance.main(PSA_ARCH_TESTS_REF, expected_failures=EXPECTED_FAILURES) From 32da0ae9c3979e1b33ce6bc76c92557f276a7a9c Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 30 Sep 2025 16:57:50 +0200 Subject: [PATCH 3/4] Improve docstring following the split Signed-off-by: Gilles Peskine --- tests/scripts/test_psa_compliance.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/scripts/test_psa_compliance.py b/tests/scripts/test_psa_compliance.py index 025c8b96d0..b902476f73 100755 --- a/tests/scripts/test_psa_compliance.py +++ b/tests/scripts/test_psa_compliance.py @@ -1,10 +1,14 @@ #!/usr/bin/env python3 """Run the PSA Crypto API compliance test suite. -Clone the repo and check out the commit specified by PSA_ARCH_TEST_REPO and PSA_ARCH_TEST_REF, -then compile and run the test suite. The clone is stored at /psa-arch-tests. -Known defects in either the test suite or TF-PSA-Crypto - identified by their test -number - are ignored, while unexpected failures AND successes are reported as errors, to help +Clone the psa-arch-tests repo and check out the specified commit. +The clone is stored at /psa-arch-tests. +Check out the commit specified by the calling script and apply patches if needed. +The patches are located at /scripts/data_files/psa-arch-tests/ . +Compile the library and the compliance tests and run the test suite. + +This script can specify a list of expected failures. +Unexpected failures and successes are reported as errors, to help keep the list of known defects as up to date as possible. """ From eea0f8c0c1e073d8ca79361de773593c63e9f8ba Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 6 Oct 2025 12:06:34 +0200 Subject: [PATCH 4/4] Clarify that this is the "calling script" Signed-off-by: Gilles Peskine --- tests/scripts/test_psa_compliance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/test_psa_compliance.py b/tests/scripts/test_psa_compliance.py index b902476f73..20d02e4bea 100755 --- a/tests/scripts/test_psa_compliance.py +++ b/tests/scripts/test_psa_compliance.py @@ -3,7 +3,7 @@ Clone the psa-arch-tests repo and check out the specified commit. The clone is stored at /psa-arch-tests. -Check out the commit specified by the calling script and apply patches if needed. +Check out the commit specified in this script and apply patches if needed. The patches are located at /scripts/data_files/psa-arch-tests/ . Compile the library and the compliance tests and run the test suite.