From ab796e656bf64a607097a3c8de31cdfce0b899b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Sz=C3=A9pk=C3=BAti?= Date: Mon, 25 Oct 2021 19:29:07 +0200 Subject: [PATCH] Make the changes easier to backport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code replaced in this patch was not compatible with the development_2.x branch. Signed-off-by: Bence Szépkúti --- tests/scripts/all.sh | 12 +++++++++--- tests/scripts/test_psa_compliance.py | 5 ++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 4fd66af75..3ca29e855 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2844,15 +2844,21 @@ component_test_zeroize () { component_test_psa_compliance () { msg "build: make, default config (out-of-box), libmbedcrypto.a only" - make library/libmbedcrypto.a + make -C library libmbedcrypto.a msg "unit test: test_psa_compliance.py" ./tests/scripts/test_psa_compliance.py } support_test_psa_compliance () { - local ver=($(cmake --version | sed 's/cmake version //; y/./ /; q')) - [ "${ver[0]}" -eq 3 ] && [ "${ver[1]}" -ge 10 ] + ver="$(cmake --version)" + ver="${ver#cmake version }" + ver_major="${ver%%.*}" + + ver="${ver#*.}" + ver_minor="${ver%%.*}" + + [ "$ver_major" -eq 3 ] && [ "$ver_minor" -ge 10 ] } component_check_python_files () { diff --git a/tests/scripts/test_psa_compliance.py b/tests/scripts/test_psa_compliance.py index 07fa76e60..d6fe8c440 100755 --- a/tests/scripts/test_psa_compliance.py +++ b/tests/scripts/test_psa_compliance.py @@ -16,9 +16,8 @@ PSA_ARCH_TESTS_REF = 'crypto1.0-3.0' def main(): mbedtls_dir = os.getcwd() - mbedcrypto_lib = 'library/libmbedcrypto.a' - if not os.path.exists(mbedcrypto_lib): - subprocess.check_call(['make', mbedcrypto_lib]) + if not os.path.exists('library/libmbedcrypto.a'): + subprocess.check_call(['make', '-C', 'library', 'libmbedcrypto.a']) psa_arch_tests_dir = 'psa-arch-tests' try: