From 635a2beb74dc92173790a9e3c58d9009d2fd1904 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 12 Jul 2024 14:30:16 +0200 Subject: [PATCH] Adapt all.sh Signed-off-by: Ronald Cron --- tests/scripts/all.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index b2f6bf2a4..7590a037b 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -343,6 +343,7 @@ cleanup() rm -f include/Makefile programs/!(fuzz)/Makefile rm -f tf-psa-crypto/Makefile tf-psa-crypto/include/Makefile rm -f tf-psa-crypto/core/Makefile tf-psa-crypto/drivers/Makefile + rm -f tf-psa-crypto/tests/Makefile rm -f tf-psa-crypto/drivers/everest/Makefile rm -f tf-psa-crypto/drivers/p256-m/Makefile rm -f tf-psa-crypto/drivers/builtin/Makefile @@ -1206,7 +1207,8 @@ component_check_test_dependencies () { # Find legacy dependencies in PSA tests grep 'depends_on' \ - tests/suites/test_suite_psa*.data tests/suites/test_suite_psa*.function | + tf-psa-crypto/tests/suites/test_suite_psa*.data \ + tf-psa-crypto/tests/suites/test_suite_psa*.function | grep -Eo '!?MBEDTLS_[^: ]*' | grep -v -e MBEDTLS_PSA_ -e MBEDTLS_TEST_ | sort -u > $found @@ -1446,7 +1448,7 @@ component_test_ref_configs () { # dependency resolution for generated files and just rely on them being # present (thanks to pre_generate_files) by turning GEN_FILES off. CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . - tests/scripts/test-ref-configs.pl + tests/scripts/test-ref-configs.pl config-tfm.h } component_test_no_renegotiation () { @@ -2081,6 +2083,9 @@ skip_suites_without_constant_flow () { # secret from macros or functions inside tests/include or tests/src. SKIP_TEST_SUITES=$( git -C tests/suites grep -L TEST_CF_ 'test_suite_*.function' | + sed 's/test_suite_//; s/\.function$//' | + tr '\n' ,),$( + git -C tf-psa-crypto/tests/suites grep -L TEST_CF_ 'test_suite_*.function' | sed 's/test_suite_//; s/\.function$//' | tr '\n' ,) export SKIP_TEST_SUITES @@ -2092,6 +2097,10 @@ skip_all_except_given_suite () { ls -1 tests/suites/test_suite_*.function | grep -v $1.function | sed 's/tests.suites.test_suite_//; s/\.function$//' | + tr '\n' ,),$( + ls -1 tf-psa-crypto/tests/suites/test_suite_*.function | + grep -v $1.function | + sed 's/tf-psa-crypto.tests.suites.test_suite_//; s/\.function$//' | tr '\n' ,) export SKIP_TEST_SUITES } @@ -4511,13 +4520,13 @@ END msg "all loops unrolled" make clean - make -C tests test_suite_shax CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" - ./tests/test_suite_shax + make -C tests ../tf-psa-crypto/tests/test_suite_shax CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" + ./tf-psa-crypto/tests/test_suite_shax msg "all loops rolled up" make clean - make -C tests test_suite_shax CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=0 -DMBEDTLS_SHA3_PI_UNROLL=0 -DMBEDTLS_SHA3_CHI_UNROLL=0 -DMBEDTLS_SHA3_RHO_UNROLL=0" - ./tests/test_suite_shax + make -C tests ../tf-psa-crypto/tests/test_suite_shax CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=0 -DMBEDTLS_SHA3_PI_UNROLL=0 -DMBEDTLS_SHA3_CHI_UNROLL=0 -DMBEDTLS_SHA3_RHO_UNROLL=0" + ./tf-psa-crypto/tests/test_suite_shax } support_test_aesni_m32() { @@ -6148,6 +6157,14 @@ run_component () { esac "${dd_cmd[@]}" + if [ -d tf-psa-crypto ]; then + dd_cmd=(dd if=/dev/urandom of=./tf-psa-crypto/tests/seedfile bs=64 count=1) + case $OSTYPE in + linux*|freebsd*|openbsd*) dd_cmd+=(status=none) + esac + "${dd_cmd[@]}" + fi + # Run the component in a subshell, with error trapping and output # redirection set up based on the relevant options. if [ $KEEP_GOING -eq 1 ]; then